This is Unofficial EPICS BASE Doxygen Site
epics::pvData::PVString Class Reference

PVString is special case, since it implements SerializableArray. More...

#include "pvData.h"

+ Inheritance diagram for epics::pvData::PVString:
+ Collaboration diagram for epics::pvData::PVString:

Public Member Functions

virtual ~PVString ()
 
virtual std::ostream & dumpValue (std::ostream &o) const OVERRIDE FINAL
 
virtual void serialize (ByteBuffer *pbuffer, SerializableControl *pflusher) const OVERRIDE FINAL
 
virtual void serialize (ByteBuffer *pbuffer, SerializableControl *pflusher, size_t offset, size_t count) const OVERRIDE FINAL
 
- Public Member Functions inherited from epics::pvData::PVScalarValue< std::string >
 POINTER_DEFINITIONS (PVScalarValue)
 
virtual ~PVScalarValue ()
 
storage_t::arg_type get () const
 
void put (typename storage_t::arg_type v)
 
virtual void operator>>= (std::string &value) const
 
virtual void operator<<= (typename storage_t::arg_type value)
 
T1 getAs () const
 
virtual void getAs (AnyScalar &v) const OVERRIDE FINAL
 
void putFrom (typename detail::ScalarStorageOps< T1 >::arg_type val)
 
void putFrom (const AnyScalar &v)
 
virtual void putFrom (const void *src, ScalarType stype) OVERRIDE FINAL
 Convert and assign. More...
 
virtual void assign (const PVScalar &scalar) OVERRIDE FINAL
 
virtual void copy (const PVScalar &from) OVERRIDE FINAL
 
virtual void copyUnchecked (const PVScalar &from) OVERRIDE FINAL
 
virtual void deserialize (ByteBuffer *pbuffer, DeserializableControl *pflusher) OVERRIDE FINAL
 
- Public Member Functions inherited from epics::pvData::PVScalar
 POINTER_DEFINITIONS (PVScalar)
 
virtual ~PVScalar ()
 
const ScalarConstPtr getScalar () const
 
template<typename T >
getAs () const
 
template<typename T >
void putFrom (T val)
 
void putFrom (const AnyScalar &v)
 
- Public Member Functions inherited from epics::pvData::PVField
 POINTER_DEFINITIONS (PVField)
 
virtual ~PVField ()
 
const std::string & getFieldName () const
 
std::string getFullName () const
 
std::size_t getFieldOffset () const
 
std::size_t getNextFieldOffset () const
 
std::size_t getNumberFields () const
 
bool isImmutable () const
 
virtual void setImmutable ()
 
const FieldConstPtrgetField () const
 
PVStructuregetParent ()
 
const PVStructuregetParent () const
 
void postPut ()
 
void setPostHandler (PostHandlerPtr const &postHandler)
 
virtual bool equals (PVField &pv)
 
void copy (const PVField &from)
 
void copyUnchecked (const PVField &from)
 
- Public Member Functions inherited from epics::pvData::Serializable
virtual ~Serializable ()
 

Protected Member Functions

 PVString (ScalarConstPtr const &scalar)
 
- Protected Member Functions inherited from epics::pvData::PVScalarValue< std::string >
virtual void getAs (void *result, ScalarType rtype) const OVERRIDE FINAL
 
 PVScalarValue (ScalarConstPtr const &scalar)
 
- Protected Member Functions inherited from epics::pvData::PVScalar
 PVScalar (ScalarConstPtr const &scalar)
 
- Protected Member Functions inherited from epics::pvData::PVField
PVField::shared_pointer getPtrSelf ()
 
 PVField (FieldConstPtr field)
 
void setParentAndName (PVStructure *parent, std::string const &fieldName)
 

Friends

class PVDataCreate
 

Additional Inherited Members

- Public Types inherited from epics::pvData::PVScalarValue< std::string >
typedef std::string value_type
 
typedef std::string * pointer
 
typedef const std::string * const_pointer
 
- Public Types inherited from epics::pvData::PVScalar
typedef PVScalarreference
 
typedef const PVScalarconst_reference
 
- Public Types inherited from epics::pvData::PVField
enum  { isPVField =1 }
 
- Static Public Attributes inherited from epics::pvData::PVScalarValue< std::string >
static const ScalarType typeCode
 
- Static Public Attributes inherited from epics::pvData::PVField
static size_t num_instances
 
- Protected Attributes inherited from epics::pvData::PVScalarValue< std::string >
storage_t storage
 

Detailed Description

PVString is special case, since it implements SerializableArray.

Definition at line 521 of file pvData.h.

Constructor & Destructor Documentation

virtual epics::pvData::PVString::~PVString ( )
inlinevirtual

Destructor

Definition at line 526 of file pvData.h.

526 {}
epics::pvData::PVString::PVString ( ScalarConstPtr const &  scalar)
explicitprotected

Definition at line 135 of file PVDataCreateFactory.cpp.

136  : PVScalarValue<std::string>(scalar)
137 {
138  BoundedStringConstPtr boundedString = std::tr1::dynamic_pointer_cast<const BoundedString>(scalar);
139  if (boundedString.get())
140  storage.maxLength = boundedString->getMaximumLength();
141  else
142  storage.maxLength = 0;
143 }
std::tr1::shared_ptr< const BoundedString > BoundedStringConstPtr
Definition: pvIntrospect.h:178
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r) BOOST_NOEXCEPT
Definition: shared_ptr.hpp:808

Member Function Documentation

std::ostream & epics::pvData::PVString::dumpValue ( std::ostream &  o) const
virtual

Puts the PVField raw value to the stream.

Parameters
ooutput stream.
Returns
The output stream.

Reimplemented from epics::pvData::PVScalarValue< std::string >.

Definition at line 145 of file PVDataCreateFactory.cpp.

146 {
147  // we escape, but do not quote, for scalar string
148  o<<escape(get());
149  return o;
150 }
void epics::pvData::PVString::serialize ( ByteBuffer pbuffer,
SerializableControl pflusher 
) const
virtual

Serialize field into given buffer.

Parameters
bufferserialization buffer.
flusherflush interface.

Reimplemented from epics::pvData::PVScalarValue< std::string >.

Definition at line 156 of file PVDataCreateFactory.cpp.

virtual void serialize(ByteBuffer *pbuffer, SerializableControl *pflusher) const OVERRIDE
char * pbuffer
Definition: errlog.c:85
void epics::pvData::PVString::serialize ( ByteBuffer pbuffer,
SerializableControl pflusher,
size_t  offset,
size_t  count 
) const
virtual

Definition at line 160 of file PVDataCreateFactory.cpp.

162 {
163  // check bounds
164  const size_t length = storage.value.length();
165  /*if (offset < 0) offset = 0;
166  else*/ if (offset > length) offset = length;
167  //if (count < 0) count = length;
168 
169  const size_t maxCount = length - offset;
170  if (count > maxCount)
171  count = maxCount;
172 
173  // write
174  SerializeHelper::serializeSubstring(storage.value, offset, count, pbuffer, pflusher);
175 }
char * pbuffer
Definition: errlog.c:85
static void serializeSubstring(const std::string &value, std::size_t offset, std::size_t count, ByteBuffer *buffer, SerializableControl *flusher)

Friends And Related Function Documentation

friend class PVDataCreate
friend

Definition at line 537 of file pvData.h.


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