several minor problems found while developing pvDatabaseCPP
This commit is contained in:
@@ -62,7 +62,11 @@ template<typename T>
|
||||
T BasePVScalar<T>::get() const { return value;}
|
||||
|
||||
template<typename T>
|
||||
void BasePVScalar<T>::put(T val){value = val;}
|
||||
void BasePVScalar<T>::put(T val)
|
||||
{
|
||||
value = val;
|
||||
PVField::postPut();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void BasePVScalar<T>::serialize(ByteBuffer *pbuffer,
|
||||
@@ -120,7 +124,11 @@ BasePVString::~BasePVString() {}
|
||||
|
||||
String BasePVString::get() const { return value;}
|
||||
|
||||
void BasePVString::put(String val){value = val;}
|
||||
void BasePVString::put(String val)
|
||||
{
|
||||
value = val;
|
||||
postPut();
|
||||
}
|
||||
|
||||
void BasePVString::serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher) const
|
||||
|
||||
@@ -158,7 +158,7 @@ void PVField::renameField(String const & newName)
|
||||
|
||||
void PVField::postPut()
|
||||
{
|
||||
if(postHandler!=NULL) postHandler->postPut();
|
||||
if(postHandler.get()!=NULL) postHandler->postPut();
|
||||
}
|
||||
|
||||
void PVField::setPostHandler(PostHandlerPtr const &handler)
|
||||
|
||||
@@ -44,6 +44,15 @@ public:
|
||||
locked=false;
|
||||
}
|
||||
}
|
||||
bool tryLock()
|
||||
{
|
||||
if(locked) return true;
|
||||
if(mutexPtr.tryLock()) {
|
||||
locked = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool ownsLock() const{return locked;}
|
||||
private:
|
||||
Mutex &mutexPtr;
|
||||
|
||||
@@ -75,6 +75,8 @@ typedef std::vector<PVStructurePtr>::const_iterator PVStructurePtrArray_const__i
|
||||
* typedef for a pointer to a PVStructureArray.
|
||||
*/
|
||||
typedef std::tr1::shared_ptr<PVStructureArray> PVStructureArrayPtr;
|
||||
typedef std::vector<PVStructureArrayPtr> PVStructureArrayPtrArray;
|
||||
typedef std::tr1::shared_ptr<PVStructureArrayPtrArray> PVStructureArrayPtrArrayPtr;
|
||||
|
||||
/**
|
||||
* This class provides auxillary information about a PVField.
|
||||
@@ -140,8 +142,7 @@ private:
|
||||
/**
|
||||
* This class is implemented by code that calls setPostHander
|
||||
*/
|
||||
class PostHandler :
|
||||
public std::tr1::enable_shared_from_this<PostHandler>
|
||||
class PostHandler
|
||||
{
|
||||
public:
|
||||
POINTER_DEFINITIONS(PostHandler);
|
||||
|
||||
Reference in New Issue
Block a user