PMDA++  0.4.4
Header-only C++ library for writing PCP PMDAs
Namespaces | Classes | Typedefs | Enumerations | Functions
pcp Namespace Reference

Namespaces

 cache
 

Classes

class  exception
 Base class for all PMDA++ exceptions. More...
 
class  instance_domain
 Performance metric instance domain. More...
 
struct  instance_info
 Basic instance domain information. More...
 
class  metric_cluster
 A cluster of metric descriptions. More...
 
struct  metric_description
 Individual metric description. More...
 
class  metrics_description
 Collection of clusters of metric descriptions. More...
 
class  pmda
 Abstract base class for implementing PCP PMDAs. More...
 

Typedefs

typedef uint_fast8_t atom_type_type
 PM_TYPE_* (0 - 9) More...
 
typedef uint_fast16_t cluster_id_type
 __pmID_int::cluster (12-bits) More...
 
typedef uint_fast16_t domain_id_type
 __pmID_int::cluster (9-bits); pmdaIndom::it_indom More...
 
typedef unsigned int instance_id_type
 https://github.com/pcolby/pcp-pmda-cpp/issues/11 More...
 
typedef uint_fast16_t item_id_type
 __pmID_int::item (10-bits) More...
 
typedef uint_fast8_t semantic_type
 PM_SEM_* (0 - 4) More...
 

Enumerations

enum  metric_flags { storable_metric = 0x1 }
 Flags that may be applied to metric descriptions. More...
 

Functions

template<typename ValueType >
pmAtomValue atom (const atom_type_type type, ValueType value)
 Caset a value to a PCP pmAtomValue. More...
 
template<>
pmAtomValue atom< char * > (const atom_type_type type, char *value)
 Caset a value to a PCP pmAtomValue. More...
 
template<>
pmAtomValue atom< pmValueBlock * > (const atom_type_type type, pmValueBlock *value)
 Caset a value to a PCP pmAtomValue. More...
 
template<typename Type >
Type get_pcp_runtime_version ()
 Get the PCP runtime version as a numeric value. More...
 
template<>
char * get_pcp_runtime_version ()
 Get the PCP runtime version as a string. More...
 
metric_flags operator| (metric_flags a, metric_flags b)
 Pipe operator for combining metric_flags values. More...
 
template<typename Type >
atom_type_type type ()
 Get the PM_TYPE_* constant for a given C++ type. More...
 
template<>
atom_type_type type< int8_t > ()
 Template specialisation for int8_t. More...
 
template<>
atom_type_type type< int16_t > ()
 Template specialisation for int16_t. More...
 
template<>
atom_type_type type< int32_t > ()
 Template specialisation for int32_t. More...
 
template<>
atom_type_type type< int64_t > ()
 Template specialisation for int64_t. More...
 
template<>
atom_type_type type< uint8_t > ()
 Template specialisation for uint8_t. More...
 
template<>
atom_type_type type< uint16_t > ()
 Template specialisation for uint16_t. More...
 
template<>
atom_type_type type< uint32_t > ()
 Template specialisation for uint32_t. More...
 
template<>
atom_type_type type< uint64_t > ()
 Template specialisation for uint64_t. More...
 
template<>
atom_type_type type< float > ()
 Template specialisation for float. More...
 
template<>
atom_type_type type< double > ()
 Template specialisation for double. More...
 
template<>
atom_type_type type< char * > ()
 Template specialisation for char *. More...
 
template<>
atom_type_type type< std::string > ()
 Template specialisation for std::string. More...
 
pmUnits units (int a, int b, int c, unsigned d, unsigned e, int f)
 Wrapper for PMDA_PMUNITS. More...
 

Typedef Documentation

◆ atom_type_type

typedef uint_fast8_t pcp::atom_type_type

PM_TYPE_* (0 - 9)

Definition at line 22 of file types.hpp.

◆ cluster_id_type

typedef uint_fast16_t pcp::cluster_id_type

__pmID_int::cluster (12-bits)

Definition at line 23 of file types.hpp.

◆ domain_id_type

typedef uint_fast16_t pcp::domain_id_type

__pmID_int::cluster (9-bits); pmdaIndom::it_indom

Definition at line 24 of file types.hpp.

◆ instance_id_type

typedef unsigned int pcp::instance_id_type

◆ item_id_type

typedef uint_fast16_t pcp::item_id_type

__pmID_int::item (10-bits)

Definition at line 26 of file types.hpp.

◆ semantic_type

typedef uint_fast8_t pcp::semantic_type

PM_SEM_* (0 - 4)

Definition at line 27 of file types.hpp.

Enumeration Type Documentation

◆ metric_flags

Flags that may be applied to metric descriptions.

Enumerator
storable_metric 

Metric supports pmstore operations.

Definition at line 30 of file metric_description.hpp.

Function Documentation

◆ atom()

template<typename ValueType >
pmAtomValue pcp::atom ( const atom_type_type  type,
ValueType  value 
)

Caset a value to a PCP pmAtomValue.

This base template definition handles most numeric types.

Parameters
typeThe atom type to set.
valueThe atom value to set.
Template Parameters
ValueTypeType of value to set.
Returns
A pmAtomValue containing value of type type.

Definition at line 35 of file atom.hpp.

Referenced by atom< char * >(), and atom< pmValueBlock * >().

◆ atom< char * >()

template<>
pmAtomValue pcp::atom< char *> ( const atom_type_type  type,
char *  value 
)
inline

Caset a value to a PCP pmAtomValue.

This template specialisation hanldes char * strings.

Note
We do not provide a const char * template specialisation, since that would require us to const_cast the value, which is something the caller ought to be very clear about / aware is happening. Hence, if you want to use a const char *, use something like: pcp::atom(PM_TYPE_STRING, const_cast<char *>(value)
Parameters
typeThe atom type to set.
valueThe atom value to set.
Returns
A pmAtomValue containing value of type type.

Definition at line 73 of file atom.hpp.

References atom().

◆ atom< pmValueBlock * >()

template<>
pmAtomValue pcp::atom< pmValueBlock *> ( const atom_type_type  type,
pmValueBlock *  value 
)
inline

Caset a value to a PCP pmAtomValue.

This template specialisation hanldes pmValueBlock values.

Parameters
typeThe atom type to set.
valueThe atom value to set.
Returns
A pmAtomValue containing value of type type.

Definition at line 105 of file atom.hpp.

References atom().

◆ get_pcp_runtime_version() [1/2]

template<typename Type >
Type pcp::get_pcp_runtime_version ( )
inline

Get the PCP runtime version as a numeric value.

Returns
The PCP runtime version as a numeric value.

Definition at line 77 of file config.hpp.

◆ get_pcp_runtime_version() [2/2]

template<>
char* pcp::get_pcp_runtime_version ( )
inline

Get the PCP runtime version as a string.

Returns
The PCP runtime version as a string.

Definition at line 92 of file config.hpp.

◆ operator|()

metric_flags pcp::operator| ( metric_flags  a,
metric_flags  b 
)
inline

Pipe operator for combining metric_flags values.

This function performs a logical OR of two metric_flags sets. This is a convenience function, allowing metric_flags enum values to be used both standalone, and in combination.

Parameters
aFirst set of flags.
bSecond set of flags.
Returns
Combined set of both a and b flags.

Definition at line 46 of file metric_description.hpp.

◆ type()

template<typename Type >
atom_type_type pcp::type ( )
inline

Get the PM_TYPE_* constant for a given C++ type.

Referenced by pcp::pmda::set_callbacks().

◆ type< char * >()

template<>
atom_type_type pcp::type< char *> ( )
inline

Template specialisation for char *.

Definition at line 47 of file types.hpp.

◆ type< double >()

template<>
atom_type_type pcp::type< double > ( )
inline

Template specialisation for double.

Definition at line 44 of file types.hpp.

◆ type< float >()

template<>
atom_type_type pcp::type< float > ( )
inline

Template specialisation for float.

Definition at line 43 of file types.hpp.

◆ type< int16_t >()

template<>
atom_type_type pcp::type< int16_t > ( )
inline

Template specialisation for int16_t.

Definition at line 34 of file types.hpp.

◆ type< int32_t >()

template<>
atom_type_type pcp::type< int32_t > ( )
inline

Template specialisation for int32_t.

Definition at line 35 of file types.hpp.

◆ type< int64_t >()

template<>
atom_type_type pcp::type< int64_t > ( )
inline

Template specialisation for int64_t.

Definition at line 36 of file types.hpp.

◆ type< int8_t >()

template<>
atom_type_type pcp::type< int8_t > ( )
inline

Template specialisation for int8_t.

Definition at line 33 of file types.hpp.

◆ type< std::string >()

template<>
atom_type_type pcp::type< std::string > ( )
inline

Template specialisation for std::string.

Definition at line 48 of file types.hpp.

◆ type< uint16_t >()

template<>
atom_type_type pcp::type< uint16_t > ( )
inline

Template specialisation for uint16_t.

Definition at line 38 of file types.hpp.

◆ type< uint32_t >()

template<>
atom_type_type pcp::type< uint32_t > ( )
inline

Template specialisation for uint32_t.

Definition at line 39 of file types.hpp.

◆ type< uint64_t >()

template<>
atom_type_type pcp::type< uint64_t > ( )
inline

Template specialisation for uint64_t.

Definition at line 40 of file types.hpp.

◆ type< uint8_t >()

template<>
atom_type_type pcp::type< uint8_t > ( )
inline

Template specialisation for uint8_t.

Definition at line 37 of file types.hpp.

◆ units()

pmUnits pcp::units ( int  a,
int  b,
int  c,
unsigned  d,
unsigned  e,
int  f 
)
inline

Wrapper for PMDA_PMUNITS.

This allows C++11-style initialisation lists, while avoiding C++ "extended initializer lists" warnings.

Parameters
aThe first argument to pass to the PMDA_PMUNITS macro (dimTime).
bThe second argument to pass to the PMDA_PMUNITS macro (dimSpace).
cThe third argument to pass to the PMDA_PMUNITS macro (dimCount).
dThe fourth argument to pass to the PMDA_PMUNITS macro (scaleSpace).
eThe fifth argument to pass to the PMDA_PMUNITS macro (scaleTime).
fThe sixth argument to pass to the PMDA_PMUNITS macro (scaleCount).
Returns
A pmUnits value constructed from the supplied arguments.

Definition at line 37 of file units.hpp.