#include "valueBuilder.h"
Incrementally define and initialize a PVStructure
Equivalent to FieldBuilder with the added ability to assign initial values.
.add<pvInt>("intfld", 42)
.add<pvString>("strfld", "testing")
Definition at line 31 of file valueBuilder.h.
epics::pvData::ValueBuilder::ValueBuilder |
( |
const std::string & |
id = std::string() | ) |
|
|
explicit |
epics::pvData::ValueBuilder::ValueBuilder |
( |
const PVStructure & |
clone | ) |
|
|
explicit |
Clone existing definition and value.
Definition at line 147 of file valueBuilder.cpp.
std::tr1::shared_ptr< const Structure > StructureConstPtr
static void fillStruct(ValueBuilder &self, const PVStructure &val)
epics::pvData::ValueBuilder::~ValueBuilder |
( |
| ) |
|
Definition at line 160 of file valueBuilder.cpp.
162 for(children_t::const_iterator it=children.begin(), end=children.end(); it!=end; ++it)
template<ScalarType ENUM>
Add a scalar field with a given name and initial value.
Definition at line 42 of file valueBuilder.h.
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.
228 THROW_EXCEPTION2(std::invalid_argument,
"addNested() only supports structure");
230 children_t::const_iterator it(children.find(name));
231 if(it==children.end()) {
232 epics::auto_ptr<child_struct> store(
new child_struct(
this,
id));
234 children[name] = store.get();
239 std::ostringstream msg;
240 msg<<
"Can't replace non-struct field '"<<name<<
"' with struct";
243 sub->builder.id = id;
friend struct child_struct
#define THROW_EXCEPTION2(TYPE, MSG)
pvd::StructureConstPtr type
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.
277 THROW_EXCEPTION2(std::logic_error,
"Only top level structure may be built. Missing endNested() ?");
285 type = tbuild->createStructure();
288 PVStructure::shared_pointer root(type->build());
#define THROW_EXCEPTION2(TYPE, MSG)
pvd::StructureConstPtr type
std::tr1::shared_ptr< const Structure > StructureConstPtr
std::tr1::shared_ptr< FieldBuilder > FieldBuilderPtr
static void buildStruct(const ValueBuilder &self, FieldBuilderPtr &builder)
FORCE_INLINE const FieldCreatePtr & getFieldCreate()
static void storeStruct(const ValueBuilder &self, const PVStructurePtr &val)
End a sub-structure.
Definition at line 247 of file valueBuilder.cpp.
#define THROW_EXCEPTION2(TYPE, MSG)
The documentation for this class was generated from the following files: