PVData C++ 8.0.7
Loading...
Searching...
No Matches
epics::pvData::ValueBuilder Class Reference

#include <pv/valueBuilder.h>

Public Member Functions

 ValueBuilder (const std::string &id=std::string())
 empty structure
 
 ValueBuilder (const PVStructure &)
 Clone existing definition and value.
 
template<ScalarType ENUM>
ValueBuilderadd (const std::string &name, typename meta::arg_type< typename ScalarTypeTraits< ENUM >::type >::type V)
 Add a scalar field with a given name and initial value.
 
template<class T >
ValueBuilderadd (const std::string &name, const shared_vector< const T > &V)
 Add a scalar array field.
 
ValueBuilderadd (const std::string &name, const PVStructure &V)
 
ValueBuilderaddNested (const std::string &name, Type type=structure, const std::string &id=std::string())
 Start a sub-structure.
 
ValueBuilderendNested ()
 End a sub-structure.
 
std::tr1::shared_ptr< PVStructurebuildPVStructure () const
 

Friends

struct child
 
struct child_struct
 
struct child_scalar_base
 
template<typename T >
struct child_scalar
 
struct child_scalar_array
 

Detailed Description

Incrementally define and initialize a PVStructure

Equivalent to FieldBuilder with the added ability to assign initial values.

.add<pvInt>("intfld", 42)
.addNested("sub")
.add<pvString>("strfld", "testing")
std::tr1::shared_ptr< PVStructure > buildPVStructure() const
ValueBuilder & endNested()
End a sub-structure.
ValueBuilder & addNested(const std::string &name, Type type=structure, const std::string &id=std::string())
Start a sub-structure.
std::tr1::shared_ptr< PVStructure > PVStructurePtr
Definition pvData.h:87

Definition at line 31 of file valueBuilder.h.

Constructor & Destructor Documentation

◆ ValueBuilder() [1/2]

epics::pvData::ValueBuilder::ValueBuilder ( const std::string & id = std::string())
explicit

empty structure

Definition at line 104 of file valueBuilder.cpp.

◆ ValueBuilder() [2/2]

epics::pvData::ValueBuilder::ValueBuilder ( const PVStructure & clone)
explicit

Clone existing definition and value.

Definition at line 147 of file valueBuilder.cpp.

◆ ~ValueBuilder()

epics::pvData::ValueBuilder::~ValueBuilder ( )

Definition at line 160 of file valueBuilder.cpp.

Member Function Documentation

◆ add() [1/3]

ValueBuilder & epics::pvData::ValueBuilder::add ( const std::string & name,
const PVStructure & V )
inline

Definition at line 56 of file valueBuilder.h.

◆ add() [2/3]

template<class T >
ValueBuilder & epics::pvData::ValueBuilder::add ( const std::string & name,
const shared_vector< const T > & V )
inline

Add a scalar array field.

Definition at line 50 of file valueBuilder.h.

◆ add() [3/3]

template<ScalarType ENUM>
ValueBuilder & epics::pvData::ValueBuilder::add ( const std::string & name,
typename meta::arg_type< typename ScalarTypeTraits< ENUM >::type >::type V )
inline

Add a scalar field with a given name and initial value.

Definition at line 42 of file valueBuilder.h.

◆ addNested()

ValueBuilder & epics::pvData::ValueBuilder::addNested ( const std::string & name,
Type type = structure,
const std::string & id = std::string() )

Start a sub-structure.

Definition at line 225 of file valueBuilder.cpp.

◆ buildPVStructure()

PVStructure::shared_pointer epics::pvData::ValueBuilder::buildPVStructure ( ) const

Complete building structure

Note
ValueBuilder may be re-used after calling buildPVStructure()

Definition at line 274 of file valueBuilder.cpp.

◆ endNested()

ValueBuilder & epics::pvData::ValueBuilder::endNested ( )

End a sub-structure.

Definition at line 247 of file valueBuilder.cpp.

Friends And Related Symbol Documentation

◆ child

friend struct child
friend

Definition at line 81 of file valueBuilder.h.

◆ child_scalar

template<typename T >
friend struct child_scalar
friend

Definition at line 87 of file valueBuilder.h.

◆ child_scalar_array

friend struct child_scalar_array
friend

Definition at line 89 of file valueBuilder.h.

◆ child_scalar_base

friend struct child_scalar_base
friend

Definition at line 85 of file valueBuilder.h.

◆ child_struct

friend struct child_struct
friend

Definition at line 83 of file valueBuilder.h.


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