12 #define epicsExportSharedSymbols 21 namespace epics {
namespace pvData {
23 string PVEnumerated::notFound(
"No enumerated structure found");
24 string PVEnumerated::notAttached(
"Not attached to an enumerated structure");
28 if(pvField->getField()->getType()!=
structure)
return false;
30 pvIndex = pvStructure->getSubField<
PVInt>(
"index");
31 if(pvIndex.get()==
NULL)
return false;
33 if(pvStringArray.get()==
NULL) {
37 pvChoices = pvStringArray;
48 if(pvIndex.get()==
NULL)
return false;
54 if(pvIndex.get()==
NULL ) {
55 throw std::logic_error(notAttached);
57 if(pvIndex->isImmutable())
return false;
64 if(pvIndex.get()==
NULL ) {
65 throw std::logic_error(notAttached);
67 return pvIndex->get();
72 if(pvIndex.get()==
NULL ) {
73 throw std::logic_error(notAttached);
75 size_t index = pvIndex->get();
77 if( index>=data.size()) {
86 if(pvIndex.get()==
NULL ) {
87 throw std::logic_error(notAttached);
89 return pvChoices->isImmutable();
94 if(pvIndex.get()==
NULL ) {
95 throw std::logic_error(notAttached);
97 return static_cast<int32>(pvChoices->getLength());
102 if(pvIndex.get()==
NULL ) {
103 throw std::logic_error(notAttached);
105 if(pvChoices->isImmutable())
return false;
107 std::copy(choices.begin(), choices.end(), data.begin());
108 pvChoices->replace(freeze(data));
bool setChoices(const StringArray &choices)
shared_ptr< T > static_pointer_cast(shared_ptr< U > const &r) BOOST_NOEXCEPT
bool attach(PVFieldPtr const &pvField)
TODO only here because of the Lockable.
std::tr1::shared_ptr< PVStringArray > PVStringArrayPtr
void copy(PVValueArray< T > &pvFrom, size_t fromOffset, size_t fromStride, PVValueArray< T > &pvTo, size_t toOffset, size_t toStride, size_t count)
Copy a subarray from one scalar array to another.
template class for all extensions of PVArray.
bool setIndex(int32 index)
Data interface for a structure,.
std::tr1::shared_ptr< PVStructure > PVStructurePtr
Class that holds the data for each possible scalar type.
std::vector< std::string > StringArray
std::tr1::shared_ptr< PVField > PVFieldPtr