File: ncDim.h

package info (click to toggle)
netcdf-cxx 4.3.1-5
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 3,456 kB
  • sloc: cpp: 8,506; sh: 4,548; ansic: 4,251; xml: 173; makefile: 145
file content (83 lines) | stat: -rw-r--r-- 1,882 bytes parent folder | download | duplicates (3)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include <string>
#include "netcdf.h"

#ifndef NcDimClass
#define NcDimClass


namespace netCDF
{
  class NcGroup;  // forward declaration.

  /*! Class represents a netCDF dimension */
  class NcDim   {

  public:

    /*! destructor*/
    ~NcDim(){};

    /*! Constructor generates a \ref isNull "null object". */
    NcDim ();

    /*!
      Constructor for a dimension .
      The dimension must already exist in the netCDF file. New netCDF variables can be added using NcGroup::addNcDim();
      \param grp    Parent NcGroup object.
      \param dimId  Id of the NcDim object.
    */
    NcDim(const NcGroup& grp, int dimId);

    /*! assignment operator  */
    NcDim& operator =(const NcDim &);

    /*! equivalence operator */
    bool operator==(const NcDim& rhs) const;

    /*!  != operator */
    bool operator!=(const NcDim& rhs) const;

    /*! The copy constructor. */
    NcDim(const NcDim& ncDim);

    /*! The name of this dimension.*/
    std::string getName() const;

    /*! The netCDF Id of this dimension. */
    int getId() const {return myId;};

    /*! Gets a  NcGroup object of the parent group. */
    NcGroup getParentGroup() const;

    /*! Returns true if this is an unlimited dimension */
    bool isUnlimited() const;

    /*! The size of the dimension; for unlimited, this is the number of records written so far. */
    size_t  getSize() const;

    /*!renames the dimension */
    void rename( const std::string& newName);

    /*! Returns true if this object is null (i.e. it has no contents); otherwise returns false. */
    bool isNull() const  {return nullObject;}

    /*! comparator operator  */
    friend bool operator<(const NcDim& lhs,const NcDim& rhs);

    /*! comparator operator  */
    friend bool operator>(const NcDim& lhs,const NcDim& rhs);

  private:

    bool nullObject;

    int myId;

    int groupId;

  };
  
}


#endif