summaryrefslogtreecommitdiffstats
path: root/c++/src/H5AbstractDs.h
blob: 24f0c1cae77c2268fdadfb2a97bd57c3f982a72b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// This may look like C code, but it is really -*- C++ -*-
// Class AbstractDs is an abstract base class, from which Attribute and
// DataSet inherit.  It provides the services that are common to both
// Attribute and DataSet.  It also inherits from H5Object and passes down
// the services that H5Object provides.

#ifndef _AbstractDs_H
#define _AbstractDs_H

#ifndef H5_NO_NAMESPACE
namespace H5 {
#endif
class AbstractDs : public H5Object {
   public:
	// Gets the dataspace of this abstract dataset - pure virtual
	virtual DataSpace getSpace() const = 0;

        // Gets the class of the datatype that is used by this abstract 
	// dataset        
	H5T_class_t getTypeClass() const;

	// Gets a copy the datatype of that this abstract dataset uses.
	// Note that this datatype is a generic one and can only be accessed 
	// via generic member functions, i.e., member functions belong 
	// to DataType.  To get specific datatype, i.e. EnumType, FloatType, 
	// etc..., use the specific functions, that follow, instead .
	DataType getDataType() const;

        // Gets a copy of the specific datatype of this abstract dataset
        EnumType getEnumType() const;
        CompType getCompType() const;
        IntType getIntType() const;
        FloatType getFloatType() const;
        StrType getStrType() const;

	// Copy constructor
	AbstractDs( const AbstractDs& original );

	virtual ~AbstractDs(); 

   protected:
	// Default constructor
	AbstractDs();

	// Constructor that takes an attribute id or a dataset id.
	AbstractDs( const hid_t ds_id );

   private:
	// This member function is implemented by DataSet and Attribute
	virtual hid_t p_getType() const = 0;

	// This member function is implemented by DataSet and Attribute
        virtual void p_close() const = 0;
};
#ifndef H5_NO_NAMESPACE
}
#endif
#endif // _AbstractDs_H