Massive name changes to factory.
The changes make it clear what is a default implementation and what implements base classes defined in pvData.h.
This commit is contained in:
67
pvDataApp/factory/DefaultPVBoolean.cpp
Normal file
67
pvDataApp/factory/DefaultPVBoolean.cpp
Normal file
@@ -0,0 +1,67 @@
|
||||
/*PVBoolean.cpp*/
|
||||
/**
|
||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
||||
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
*/
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include "pvData.h"
|
||||
#include "convert.h"
|
||||
#include "factory.h"
|
||||
#include "byteBuffer.h"
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
class BasePVBoolean : public PVBoolean {
|
||||
public:
|
||||
BasePVBoolean(PVStructure *parent,ScalarConstPtr scalar);
|
||||
virtual ~BasePVBoolean();
|
||||
virtual bool get();
|
||||
virtual void put(bool val);
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher);
|
||||
virtual void deserialize(ByteBuffer *pbuffer,
|
||||
DeserializableControl *pflusher);
|
||||
virtual bool operator==(PVField& pv) ;
|
||||
virtual bool operator!=(PVField& pv) ;
|
||||
private:
|
||||
bool value;
|
||||
};
|
||||
|
||||
BasePVBoolean::BasePVBoolean(PVStructure *parent,ScalarConstPtr scalar)
|
||||
: PVBoolean(parent,scalar),value(false)
|
||||
{}
|
||||
|
||||
BasePVBoolean::~BasePVBoolean() {}
|
||||
|
||||
bool BasePVBoolean::get() { return value;}
|
||||
|
||||
void BasePVBoolean::put(bool val){value = val;}
|
||||
|
||||
void BasePVBoolean::serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher) {
|
||||
pflusher->ensureBuffer(1);
|
||||
pbuffer->putBoolean(value);
|
||||
}
|
||||
|
||||
void BasePVBoolean::deserialize(ByteBuffer *pbuffer,
|
||||
DeserializableControl *pflusher)
|
||||
{
|
||||
pflusher->ensureData(1);
|
||||
value = pbuffer->getBoolean();
|
||||
}
|
||||
|
||||
bool BasePVBoolean::operator==(PVField& pvField)
|
||||
{
|
||||
return getConvert()->equals(this, &pvField);
|
||||
}
|
||||
|
||||
bool BasePVBoolean::operator!=(PVField& pvField)
|
||||
{
|
||||
return !(getConvert()->equals(this, &pvField));
|
||||
}
|
||||
|
||||
}}
|
||||
Reference in New Issue
Block a user