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

NetCDF user-defined type. More...

#include <netcdfpp.h>

Classes

struct  CompoundField
 Compound field metadata. More...
 

Public Member Functions

Group parent () const
 Returns the parent group.
 
template<typename T >
UserType add_compound_field (const std::string &name, std::size_t offset)
 Adds a scalar field to a compound type.
 
template<typename T >
UserType add_compound_field_array (const std::string &name, std::size_t offset, const std::vector< int > &dim_sizes)
 Adds an array field to a compound type.
 
template<typename T >
UserType add_enum_member (const std::string &name, T v)
 Adds an enum member.
 
std::vector< CompoundFieldcompound_fields () const
 Returns compound field metadata.
 
template<typename T >
std::vector< std::pair< std::string, T > > enum_members () const
 Returns enum members as name/value pairs.
 
nc_type basetype () const
 Returns the base NetCDF type of enum and variable-length types.
 
std::size_t fieldscount () const
 Returns the number of fields in a compound type.
 
std::size_t memberscount () const
 Returns the number of members in an enum type.
 
std::size_t bytes_size () const
 Returns the byte size of the user-defined type.
 
int typeclass () const
 Returns NC_VLEN, NC_OPAQUE, NC_ENUM, or NC_COMPOUND.
 
- Public Member Functions inherited from netCDF::detail::Object
const std::string & name () const
 
int id () const
 

Friends

class Group
 
class Maybe< UserType >
 
class testing::TestUserType
 

Additional Inherited Members

- 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
 
- 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 user-defined type.

Member Function Documentation

◆ add_compound_field()

template<typename T >
UserType netCDF::UserType::add_compound_field ( const std::string &  name,
std::size_t  offset 
)
inline

Adds a scalar field to a compound type.

◆ add_compound_field_array()

template<typename T >
UserType netCDF::UserType::add_compound_field_array ( const std::string &  name,
std::size_t  offset,
const std::vector< int > &  dim_sizes 
)
inline

Adds an array field to a compound type.

◆ add_enum_member()

template<typename T >
UserType netCDF::UserType::add_enum_member ( const std::string &  name,
v 
)
inline

Adds an enum member.

◆ basetype()

nc_type netCDF::UserType::basetype ( ) const
inline

Returns the base NetCDF type of enum and variable-length types.

◆ bytes_size()

std::size_t netCDF::UserType::bytes_size ( ) const
inline

Returns the byte size of the user-defined type.

◆ compound_fields()

std::vector< CompoundField > netCDF::UserType::compound_fields ( ) const
inline

Returns compound field metadata.

◆ enum_members()

template<typename T >
std::vector< std::pair< std::string, T > > netCDF::UserType::enum_members ( ) const
inline

Returns enum members as name/value pairs.

◆ fieldscount()

std::size_t netCDF::UserType::fieldscount ( ) const
inline

Returns the number of fields in a compound type.

◆ memberscount()

std::size_t netCDF::UserType::memberscount ( ) const
inline

Returns the number of members in an enum type.

◆ parent()

Group netCDF::UserType::parent ( ) const
inline

Returns the parent group.

◆ typeclass()

int netCDF::UserType::typeclass ( ) const
inline

Returns NC_VLEN, NC_OPAQUE, NC_ENUM, or NC_COMPOUND.

Friends And Related Symbol Documentation

◆ Group

friend class Group
friend

◆ Maybe< UserType >

friend class Maybe< UserType >
friend

◆ testing::TestUserType

friend class testing::TestUserType
friend

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