This is Unofficial EPICS BASE Doxygen Site
epics::nt::detail::NTMatrixBuilder Class Reference

Interface for in-line creating of NTMatrix. More...

#include "ntmatrix.h"

+ Inheritance diagram for epics::nt::detail::NTMatrixBuilder:
+ Collaboration diagram for epics::nt::detail::NTMatrixBuilder:

Public Member Functions

 POINTER_DEFINITIONS (NTMatrixBuilder)
 
shared_pointer addDim ()
 
shared_pointer addDescriptor ()
 
shared_pointer addAlarm ()
 
shared_pointer addTimeStamp ()
 
shared_pointer addDisplay ()
 
epics::pvData::StructureConstPtr createStructure ()
 
epics::pvData::PVStructurePtr createPVStructure ()
 
NTMatrixPtr create ()
 
shared_pointer add (std::string const &name, epics::pvData::FieldConstPtr const &field)
 

Friends

class ::epics::nt::NTMatrix
 

Detailed Description

Interface for in-line creating of NTMatrix.

One instance can be used to create multiple instances. An instance of this object must not be used concurrently (an object has a state).

Author
dgh

Definition at line 40 of file ntmatrix.h.

Member Function Documentation

NTMatrixBuilder::shared_pointer epics::nt::detail::NTMatrixBuilder::add ( std::string const &  name,
epics::pvData::FieldConstPtr const &  field 
)

Adds extra Field to the type.

Parameters
namethe name of the field.
fieldthe field to be added.
Returns
this instance of NTMatrixBuilder.

Definition at line 111 of file ntmatrix.cpp.

112 {
113  extraFields.push_back(field); extraFieldNames.push_back(name);
114  return shared_from_this();
115 }
NTMatrixBuilder::shared_pointer epics::nt::detail::NTMatrixBuilder::addAlarm ( )

Adds alarm field to the NTMatrix.

Returns
this instance of NTMatrixBuilder.

Definition at line 67 of file ntmatrix.cpp.

68 {
69  alarm = true;
70  return shared_from_this();
71 }
NTMatrixBuilder::shared_pointer epics::nt::detail::NTMatrixBuilder::addDescriptor ( )

Adds descriptor field to the NTMatrix.

Returns
this instance of NTMatrixBuilder.

Definition at line 61 of file ntmatrix.cpp.

62 {
63  descriptor = true;
64  return shared_from_this();
65 }
NTMatrixBuilder::shared_pointer epics::nt::detail::NTMatrixBuilder::addDim ( )

Adds dimension field to the NTMatrix.

Returns
this instance of NTMatrixBuilder.

Definition at line 55 of file ntmatrix.cpp.

56 {
57  dim = true;
58  return shared_from_this();
59 }
NTMatrixBuilder::shared_pointer epics::nt::detail::NTMatrixBuilder::addDisplay ( )

Adds display field to the NTMatrix.

Returns
this instance of NTMatrixBuilder.

Definition at line 79 of file ntmatrix.cpp.

80 {
81  display = true;
82  return shared_from_this();
83 }
NTMatrixBuilder::shared_pointer epics::nt::detail::NTMatrixBuilder::addTimeStamp ( )

Adds timeStamp field to the NTMatrix.

Returns
this instance of NTMatrixBuilder.

Definition at line 73 of file ntmatrix.cpp.

74 {
75  timeStamp = true;
76  return shared_from_this();
77 }
NTMatrixPtr epics::nt::detail::NTMatrixBuilder::create ( )

Creates a NTMatrix instance. This resets this instance state and allows new instance to be created.

Returns
a new instance of NTMatrix.

Definition at line 90 of file ntmatrix.cpp.

91 {
92  return NTMatrixPtr(new NTMatrix(createPVStructure()));
93 }
epics::pvData::PVStructurePtr createPVStructure()
Definition: ntmatrix.cpp:85
std::tr1::shared_ptr< NTMatrix > NTMatrixPtr
Definition: ntmatrix.h:28
PVStructurePtr epics::nt::detail::NTMatrixBuilder::createPVStructure ( )

Creates a PVStructure that represents NTMatrix. This resets this instance state and allows new instance to be created.

Returns
a new instance of PVStructure.

Definition at line 85 of file ntmatrix.cpp.

86 {
87  return getPVDataCreate()->createPVStructure(createStructure());
88 }
epics::pvData::StructureConstPtr createStructure()
Definition: ntmatrix.cpp:22
FORCE_INLINE const PVDataCreatePtr & getPVDataCreate()
Definition: pvData.h:1648
StructureConstPtr epics::nt::detail::NTMatrixBuilder::createStructure ( )

Creates a Structure that represents NTMatrix. This resets this instance state and allows new instance to be created.

Returns
a new instance of Structure.

Definition at line 22 of file ntmatrix.cpp.

23 {
24  FieldBuilderPtr builder =
25  getFieldCreate()->createFieldBuilder()->
26  setId(NTMatrix::URI)->
27  addArray("value", pvDouble);
28 
29  if (dim)
30  builder->addArray("dim", pvInt);
31 
32  if (descriptor)
33  builder->add("descriptor", pvString);
34 
35  if (alarm)
36  builder->add("alarm", ntField->createAlarm());
37 
38  if (timeStamp)
39  builder->add("timeStamp", ntField->createTimeStamp());
40 
41  if (display)
42  builder->add("display", ntField->createDisplay());
43 
44  size_t extraCount = extraFieldNames.size();
45  for (size_t i = 0; i< extraCount; i++)
46  builder->add(extraFieldNames[i], extraFields[i]);
47 
48 
49  StructureConstPtr s = builder->createStructure();
50 
51  reset();
52  return s;
53 }
int i
Definition: scan.c:967
std::tr1::shared_ptr< const Structure > StructureConstPtr
Definition: pvIntrospect.h:162
std::tr1::shared_ptr< FieldBuilder > FieldBuilderPtr
FORCE_INLINE const FieldCreatePtr & getFieldCreate()
static const std::string URI
Definition: ntmatrix.h:139
epics::nt::detail::NTMatrixBuilder::POINTER_DEFINITIONS ( NTMatrixBuilder  )

Friends And Related Function Documentation

friend class ::epics::nt::NTMatrix
friend

Definition at line 120 of file ntmatrix.h.


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