netcdfpp
Header-only NetCDF C++ wrapper
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Friends | List of all members
netCDF::Group Class Reference

NetCDF group, including the root group represented by File. More...

#include <netcdfpp.h>

Public Member Functions

Attribute add_attribute (std::string name)
 Defines an attribute handle. The attribute is created when a value is written.
 
Attribute add_attribute (const Attribute &a)
 Copies an attribute into this group.
 
Dimension add_dimension (std::string name)
 Defines an unlimited dimension.
 
Dimension add_dimension (std::string name, std::size_t len)
 Defines a fixed-size dimension.
 
Dimension add_dimension (const Dimension &d)
 Copies a dimension into this group.
 
template<typename T >
Variable add_dimension_variable (std::string name)
 Defines an unlimited dimension and a variable with the same name.
 
template<typename T >
Variable add_dimension_variable (std::string name, std::size_t len)
 Defines a fixed-size dimension and a variable with the same name.
 
template<typename T >
Variable add_dimension_variable (const Dimension &d)
 Defines a variable with the same name and extent as an existing dimension.
 
Group add_group (std::string name)
 Defines a child group.
 
Group add_group (const Group &g, bool variable_values=false)
 Copies a group into this group.
 
UserType add_type_compound (std::string name, std::size_t bytes_size)
 Defines a compound user type with an explicit byte size.
 
template<typename T >
UserType add_type_compound (std::string name)
 Defines a compound user type with sizeof(T).
 
UserType add_type_enum (std::string name, nc_type basetype)
 Defines an enum user type with an explicit NetCDF base type.
 
template<typename T >
UserType add_type_enum (std::string name)
 Defines an enum user type using the C++ enum underlying type.
 
UserType add_type_vlen (std::string name, nc_type basetype)
 Defines a variable-length user type with an explicit NetCDF base type.
 
template<typename T >
UserType add_type_vlen (std::string name)
 Defines a variable-length user type using the mapped NetCDF type of T.
 
UserType add_type_opaque (std::string name, std::size_t bytes_size)
 Defines an opaque user type.
 
UserType add_user_type (const UserType &t)
 Copies a user-defined type into this group.
 
Variable add_variable (std::string name, const UserType &type, const std::vector< int > &dims)
 Defines a variable using a user-defined type and dimension ids.
 
Variable add_variable (std::string name, const UserType &type, const std::vector< Dimension > &dims)
 Defines a variable using a user-defined type and dimension objects.
 
Variable add_variable (std::string name, const UserType &type, const std::vector< std::string > &dims)
 Defines a variable using a user-defined type and dimension names.
 
Variable add_variable (std::string name, nc_type type, const std::vector< int > &dims)
 Defines a variable using a NetCDF type id and dimension ids.
 
Variable add_variable (std::string name, nc_type type, const std::vector< Dimension > &dims)
 Defines a variable using a NetCDF type id and dimension objects.
 
Variable add_variable (std::string name, nc_type type, const std::vector< std::string > &dims)
 Defines a variable using a NetCDF type id and dimension names.
 
template<typename T >
Variable add_variable (std::string name, const std::vector< int > &dims)
 Defines a variable using the mapped NetCDF type of T and dimension ids.
 
template<typename T >
Variable add_variable (std::string name, const std::vector< Dimension > &dims)
 Defines a variable using the mapped NetCDF type of T and dimension objects.
 
template<typename T >
Variable add_variable (std::string name, const std::vector< std::string > &dims)
 Defines a variable using the mapped NetCDF type of T and dimension names.
 
Variable add_variable (const Variable &v, bool with_values=false)
 Copies a variable definition into this group.
 
Maybe< Attributeattribute (std::string name) const
 Looks up a group attribute by name.
 
std::vector< Attributeattributes () const
 Returns all group attributes.
 
void copy_attributes (const Group &g)
 Copies all group attributes from another group.
 
void copy_dimensions (const Group &g)
 Copies all dimensions from another group.
 
void copy_from (const Group &g, bool variable_values=false)
 Copies attributes, dimensions, user types, variables, and child groups.
 
void copy_groups (const Group &g, bool variable_values=false)
 Copies child groups from another group.
 
void copy_user_types (const Group &g)
 Copies user-defined types from another group.
 
void copy_variables (const Group &g, bool variable_values=false)
 Copies variables from another group.
 
Maybe< Dimensiondimension (std::string name) const
 Looks up a dimension by name.
 
std::vector< Dimensiondimensions () const
 Returns all dimensions visible in this group.
 
Maybe< Groupgroup (std::string name) const
 Looks up a child group by name.
 
std::vector< Groupgroups () const
 Returns all direct child groups.
 
void rename (std::string name)
 Renames the group in place.
 
Maybe< Groupparent () const
 Returns the parent group, if this is not the root group.
 
Maybe< UserTypeuser_type (std::string name) const
 Looks up a user-defined type by name.
 
std::vector< UserTypeuser_types () const
 Returns all user-defined types in this group.
 
Maybe< Variablevariable (std::string name) const
 Looks up a variable by name.
 
std::vector< Variablevariables () const
 Returns all variables in this group.
 
- Public Member Functions inherited from netCDF::detail::Object
const std::string & name () const
 
int id () const
 

Protected Member Functions

 Group (std::shared_ptr< detail::Path > path_p)
 
- Protected Member Functions inherited from netCDF::detail::Object
 Object (std::shared_ptr< Path > path_p)
 
void raise_error (int ret) const
 
void check (int ret) const
 

Friends

class Attribute
 
class Dimension
 
class Maybe< Group >
 
class UserType
 
class Variable
 

Additional Inherited Members

- Static Protected Member Functions inherited from netCDF::detail::Object
static std::string get_error_message (int ret)
 
- Protected Attributes inherited from netCDF::detail::Object
std::shared_ptr< Pathpath
 

Detailed Description

NetCDF group, including the root group represented by File.

Constructor & Destructor Documentation

◆ Group()

netCDF::Group::Group ( std::shared_ptr< detail::Path path_p)
inlineexplicitprotected

Member Function Documentation

◆ add_attribute() [1/2]

Attribute netCDF::Group::add_attribute ( const Attribute a)
inline

Copies an attribute into this group.

◆ add_attribute() [2/2]

Attribute netCDF::Group::add_attribute ( std::string  name)
inline

Defines an attribute handle. The attribute is created when a value is written.

◆ add_dimension() [1/3]

Dimension netCDF::Group::add_dimension ( const Dimension d)
inline

Copies a dimension into this group.

◆ add_dimension() [2/3]

Dimension netCDF::Group::add_dimension ( std::string  name)
inline

Defines an unlimited dimension.

◆ add_dimension() [3/3]

Dimension netCDF::Group::add_dimension ( std::string  name,
std::size_t  len 
)
inline

Defines a fixed-size dimension.

◆ add_dimension_variable() [1/3]

template<typename T >
Variable netCDF::Group::add_dimension_variable ( const Dimension d)
inline

Defines a variable with the same name and extent as an existing dimension.

◆ add_dimension_variable() [2/3]

template<typename T >
Variable netCDF::Group::add_dimension_variable ( std::string  name)
inline

Defines an unlimited dimension and a variable with the same name.

◆ add_dimension_variable() [3/3]

template<typename T >
Variable netCDF::Group::add_dimension_variable ( std::string  name,
std::size_t  len 
)
inline

Defines a fixed-size dimension and a variable with the same name.

◆ add_group() [1/2]

Group netCDF::Group::add_group ( const Group g,
bool  variable_values = false 
)
inline

Copies a group into this group.

◆ add_group() [2/2]

Group netCDF::Group::add_group ( std::string  name)
inline

Defines a child group.

◆ add_type_compound() [1/2]

template<typename T >
UserType netCDF::Group::add_type_compound ( std::string  name)
inline

Defines a compound user type with sizeof(T).

◆ add_type_compound() [2/2]

UserType netCDF::Group::add_type_compound ( std::string  name,
std::size_t  bytes_size 
)
inline

Defines a compound user type with an explicit byte size.

◆ add_type_enum() [1/2]

template<typename T >
UserType netCDF::Group::add_type_enum ( std::string  name)
inline

Defines an enum user type using the C++ enum underlying type.

◆ add_type_enum() [2/2]

UserType netCDF::Group::add_type_enum ( std::string  name,
nc_type  basetype 
)
inline

Defines an enum user type with an explicit NetCDF base type.

◆ add_type_opaque()

UserType netCDF::Group::add_type_opaque ( std::string  name,
std::size_t  bytes_size 
)
inline

Defines an opaque user type.

◆ add_type_vlen() [1/2]

template<typename T >
UserType netCDF::Group::add_type_vlen ( std::string  name)
inline

Defines a variable-length user type using the mapped NetCDF type of T.

◆ add_type_vlen() [2/2]

UserType netCDF::Group::add_type_vlen ( std::string  name,
nc_type  basetype 
)
inline

Defines a variable-length user type with an explicit NetCDF base type.

◆ add_user_type()

UserType netCDF::Group::add_user_type ( const UserType t)
inline

Copies a user-defined type into this group.

◆ add_variable() [1/10]

Variable netCDF::Group::add_variable ( const Variable v,
bool  with_values = false 
)
inline

Copies a variable definition into this group.

◆ add_variable() [2/10]

template<typename T >
Variable netCDF::Group::add_variable ( std::string  name,
const std::vector< Dimension > &  dims 
)
inline

Defines a variable using the mapped NetCDF type of T and dimension objects.

◆ add_variable() [3/10]

template<typename T >
Variable netCDF::Group::add_variable ( std::string  name,
const std::vector< int > &  dims 
)
inline

Defines a variable using the mapped NetCDF type of T and dimension ids.

◆ add_variable() [4/10]

template<typename T >
Variable netCDF::Group::add_variable ( std::string  name,
const std::vector< std::string > &  dims 
)
inline

Defines a variable using the mapped NetCDF type of T and dimension names.

◆ add_variable() [5/10]

Variable netCDF::Group::add_variable ( std::string  name,
const UserType type,
const std::vector< Dimension > &  dims 
)
inline

Defines a variable using a user-defined type and dimension objects.

◆ add_variable() [6/10]

Variable netCDF::Group::add_variable ( std::string  name,
const UserType type,
const std::vector< int > &  dims 
)
inline

Defines a variable using a user-defined type and dimension ids.

◆ add_variable() [7/10]

Variable netCDF::Group::add_variable ( std::string  name,
const UserType type,
const std::vector< std::string > &  dims 
)
inline

Defines a variable using a user-defined type and dimension names.

◆ add_variable() [8/10]

Variable netCDF::Group::add_variable ( std::string  name,
nc_type  type,
const std::vector< Dimension > &  dims 
)
inline

Defines a variable using a NetCDF type id and dimension objects.

◆ add_variable() [9/10]

Variable netCDF::Group::add_variable ( std::string  name,
nc_type  type,
const std::vector< int > &  dims 
)
inline

Defines a variable using a NetCDF type id and dimension ids.

◆ add_variable() [10/10]

Variable netCDF::Group::add_variable ( std::string  name,
nc_type  type,
const std::vector< std::string > &  dims 
)
inline

Defines a variable using a NetCDF type id and dimension names.

◆ attribute()

Maybe< Attribute > netCDF::Group::attribute ( std::string  name) const
inline

Looks up a group attribute by name.

◆ attributes()

std::vector< Attribute > netCDF::Group::attributes ( ) const
inline

Returns all group attributes.

◆ copy_attributes()

void netCDF::Group::copy_attributes ( const Group g)
inline

Copies all group attributes from another group.

◆ copy_dimensions()

void netCDF::Group::copy_dimensions ( const Group g)
inline

Copies all dimensions from another group.

◆ copy_from()

void netCDF::Group::copy_from ( const Group g,
bool  variable_values = false 
)
inline

Copies attributes, dimensions, user types, variables, and child groups.

◆ copy_groups()

void netCDF::Group::copy_groups ( const Group g,
bool  variable_values = false 
)
inline

Copies child groups from another group.

◆ copy_user_types()

void netCDF::Group::copy_user_types ( const Group g)
inline

Copies user-defined types from another group.

◆ copy_variables()

void netCDF::Group::copy_variables ( const Group g,
bool  variable_values = false 
)
inline

Copies variables from another group.

◆ dimension()

Maybe< Dimension > netCDF::Group::dimension ( std::string  name) const
inline

Looks up a dimension by name.

◆ dimensions()

std::vector< Dimension > netCDF::Group::dimensions ( ) const
inline

Returns all dimensions visible in this group.

◆ group()

Maybe< Group > netCDF::Group::group ( std::string  name) const
inline

Looks up a child group by name.

◆ groups()

std::vector< Group > netCDF::Group::groups ( ) const
inline

Returns all direct child groups.

◆ parent()

Maybe< Group > netCDF::Group::parent ( ) const
inline

Returns the parent group, if this is not the root group.

◆ rename()

void netCDF::Group::rename ( std::string  name)
inline

Renames the group in place.

◆ user_type()

Maybe< UserType > netCDF::Group::user_type ( std::string  name) const
inline

Looks up a user-defined type by name.

◆ user_types()

std::vector< UserType > netCDF::Group::user_types ( ) const
inline

Returns all user-defined types in this group.

◆ variable()

Maybe< Variable > netCDF::Group::variable ( std::string  name) const
inline

Looks up a variable by name.

◆ variables()

std::vector< Variable > netCDF::Group::variables ( ) const
inline

Returns all variables in this group.

Friends And Related Symbol Documentation

◆ Attribute

friend class Attribute
friend

◆ Dimension

friend class Dimension
friend

◆ Maybe< Group >

friend class Maybe< Group >
friend

◆ UserType

friend class UserType
friend

◆ Variable

friend class Variable
friend

The documentation for this class was generated from the following file: