PMDA++  0.4.4
Header-only C++ library for writing PCP PMDAs
units.hpp
Go to the documentation of this file.
1 // Copyright Paul Colby 2013 - 2015.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE.md or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 
6 /**
7  * @file
8  * @brief Defines the pcp::units template function.
9  */
10 
11 #ifndef __PCP_CPP_UNITS_HPP__
12 #define __PCP_CPP_UNITS_HPP__
13 
14 #include "config.hpp"
15 
16 PCP_CPP_BEGIN_NAMESPACE
17 
18 namespace pcp {
19 
20 class instance_domain;
21 
22 /**
23  * @brief Wrapper for PMDA_PMUNITS
24  *
25  * This allows C++11-style initialisation lists, while avoiding C++ "extended
26  * initializer lists" warnings.
27  *
28  * @param a The first argument to pass to the PMDA_PMUNITS macro (dimTime).
29  * @param b The second argument to pass to the PMDA_PMUNITS macro (dimSpace).
30  * @param c The third argument to pass to the PMDA_PMUNITS macro (dimCount).
31  * @param d The fourth argument to pass to the PMDA_PMUNITS macro (scaleSpace).
32  * @param e The fifth argument to pass to the PMDA_PMUNITS macro (scaleTime).
33  * @param f The sixth argument to pass to the PMDA_PMUNITS macro (scaleCount).
34  *
35  * @return A pmUnits value constructed from the supplied arguments.
36  */
37 inline pmUnits units(int a, int b, int c, unsigned d, unsigned e, int f)
38 {
39  const pmUnits units = PMDA_PMUNITS(a,b,c,d,e,f);
40  return units;
41 }
42 
43 } // pcp namespace.
44 
45 PCP_CPP_END_NAMESPACE
46 
47 #endif
pmUnits units(int a, int b, int c, unsigned d, unsigned e, int f)
Wrapper for PMDA_PMUNITS.
Definition: units.hpp:37
Definition: atom.hpp:20
Sets up common PMDA++ library macros.