moved POINTER_DEFS from pvAccess.h to sharedPtr.h
This commit is contained in:
@@ -38,9 +38,7 @@ namespace epics { namespace pvData {
|
||||
*/
|
||||
class BitSet : public Serializable {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<BitSet> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const BitSet> const_shared_pointer;
|
||||
|
||||
POINTER_DEFINITIONS(BitSet);
|
||||
/**
|
||||
* Creates a new bit set. All bits are initially {@code false}.
|
||||
*/
|
||||
|
||||
@@ -18,8 +18,7 @@ namespace epics { namespace pvData {
|
||||
*/
|
||||
class Destroyable {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<Destroyable> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const Destroyable> const_shared_pointer;
|
||||
POINTER_DEFINITIONS(Destroyable);
|
||||
/**
|
||||
* Destroy this instance.
|
||||
*/
|
||||
|
||||
@@ -22,8 +22,7 @@ extern StringArray messageTypeName;
|
||||
|
||||
class Requester {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<Requester> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const Requester> const_shared_pointer;
|
||||
POINTER_DEFINITIONS(Requester);
|
||||
|
||||
virtual ~Requester(){}
|
||||
virtual String getRequesterName() = 0;
|
||||
|
||||
@@ -58,4 +58,10 @@
|
||||
# undef SHARED_FROM_BOOST
|
||||
#endif
|
||||
|
||||
#define POINTER_DEFINITIONS(clazz) \
|
||||
typedef std::tr1::shared_ptr<clazz> shared_pointer; \
|
||||
typedef std::tr1::shared_ptr<const clazz> const_shared_pointer; \
|
||||
typedef std::tr1::weak_ptr<clazz> weak_pointer; \
|
||||
typedef std::tr1::weak_ptr<const clazz> const_weak_pointer;
|
||||
|
||||
#endif // SHAREDPTR_H
|
||||
|
||||
@@ -43,8 +43,7 @@ private:
|
||||
|
||||
class Timer : private NoDefaultMethods {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<Timer> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const Timer> const_shared_pointer;
|
||||
POINTER_DEFINITIONS(Timer);
|
||||
|
||||
Timer(String threadName, ThreadPriority priority);
|
||||
~Timer();
|
||||
|
||||
@@ -21,9 +21,7 @@ namespace epics { namespace pvData {
|
||||
*/
|
||||
class MonitorElement {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<MonitorElement> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const MonitorElement> const_shared_pointer;
|
||||
|
||||
POINTER_DEFINITIONS(MonitorElement);
|
||||
/**
|
||||
* Get the PVStructure.
|
||||
* @return The PVStructure.
|
||||
@@ -48,9 +46,7 @@ namespace epics { namespace pvData {
|
||||
*/
|
||||
class Monitor : public Destroyable, private NoDefaultMethods {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<Monitor> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const Monitor> const_shared_pointer;
|
||||
|
||||
POINTER_DEFINITIONS(Monitor);
|
||||
/**
|
||||
* Start monitoring.
|
||||
* @return completion status.
|
||||
@@ -81,9 +77,7 @@ namespace epics { namespace pvData {
|
||||
*/
|
||||
class MonitorRequester : public virtual Requester {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<MonitorRequester> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const MonitorRequester> const_shared_pointer;
|
||||
|
||||
POINTER_DEFINITIONS(MonitorRequester);
|
||||
/**
|
||||
* The client and server have both completed the createMonitor request.
|
||||
* @param status Completion status.
|
||||
|
||||
+9
-27
@@ -61,9 +61,7 @@ class PVField
|
||||
private NoDefaultMethods
|
||||
{
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<PVField> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const PVField> const_shared_pointer;
|
||||
|
||||
POINTER_DEFINITIONS(PVField);
|
||||
virtual ~PVField();
|
||||
virtual void message(String message,MessageType messageType) ;
|
||||
virtual void setRequester(Requester *prequester);
|
||||
@@ -95,9 +93,7 @@ private:
|
||||
|
||||
class PVScalar : public PVField {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<PVScalar> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const PVScalar> const_shared_pointer;
|
||||
|
||||
POINTER_DEFINITIONS(PVScalar);
|
||||
virtual ~PVScalar();
|
||||
ScalarConstPtr getScalar() ;
|
||||
protected:
|
||||
@@ -107,9 +103,7 @@ protected:
|
||||
template<typename T>
|
||||
class PVScalarValue : public PVScalar {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<PVScalarValue> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const PVScalarValue> const_shared_pointer;
|
||||
|
||||
POINTER_DEFINITIONS(PVScalarValue);
|
||||
typedef T value_type;
|
||||
typedef T* pointer;
|
||||
typedef const T* const_pointer;
|
||||
@@ -143,9 +137,7 @@ protected:
|
||||
|
||||
class PVArray : public PVField, public SerializableArray {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<PVArray> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const PVArray> const_shared_pointer;
|
||||
|
||||
POINTER_DEFINITIONS(PVArray);
|
||||
virtual ~PVArray();
|
||||
int getLength() const;
|
||||
void setLength(int length);
|
||||
@@ -164,9 +156,7 @@ private:
|
||||
template<typename T>
|
||||
class PVArrayData {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<PVArrayData> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const PVArrayData> const_shared_pointer;
|
||||
|
||||
POINTER_DEFINITIONS(PVArrayData);
|
||||
typedef T value_type;
|
||||
typedef T* pointer;
|
||||
typedef const T* const_pointer;
|
||||
@@ -178,9 +168,7 @@ public:
|
||||
|
||||
class PVScalarArray : public PVArray {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<PVScalarArray> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const PVScalarArray> const_shared_pointer;
|
||||
|
||||
POINTER_DEFINITIONS(PVScalarArray);
|
||||
virtual ~PVScalarArray();
|
||||
ScalarArrayConstPtr getScalarArray() ;
|
||||
|
||||
@@ -193,9 +181,7 @@ typedef PVArrayData<PVStructurePtr> StructureArrayData;
|
||||
|
||||
class PVStructureArray : public PVArray {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<PVStructureArray> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const PVStructureArray> const_shared_pointer;
|
||||
|
||||
POINTER_DEFINITIONS(PVStructureArray);
|
||||
virtual ~PVStructureArray() {}
|
||||
virtual StructureArrayConstPtr getStructureArray() = 0;
|
||||
virtual int append(int number) = 0;
|
||||
@@ -216,9 +202,7 @@ private:
|
||||
|
||||
class PVStructure : public PVField,public BitSetSerializable {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<PVStructure> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const PVStructure> const_shared_pointer;
|
||||
|
||||
POINTER_DEFINITIONS(PVStructure);
|
||||
virtual ~PVStructure();
|
||||
StructureConstPtr getStructure();
|
||||
PVFieldPtrArray getPVFields();
|
||||
@@ -263,9 +247,7 @@ private:
|
||||
template<typename T>
|
||||
class PVValueArray : public PVScalarArray {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<PVValueArray> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const PVValueArray> const_shared_pointer;
|
||||
|
||||
POINTER_DEFINITIONS(PVValueArray);
|
||||
typedef T value_type;
|
||||
typedef T* pointer;
|
||||
typedef const T* const_pointer;
|
||||
|
||||
@@ -61,9 +61,7 @@ namespace ScalarTypeFunc {
|
||||
|
||||
class Field : public std::tr1::enable_shared_from_this<Field> {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<Field> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const Field> const_shared_pointer;
|
||||
|
||||
POINTER_DEFINITIONS(Field);
|
||||
String getFieldName() const{return m_fieldName;}
|
||||
Type getType() const{return m_type;}
|
||||
virtual void toString(StringBuilder buf) const{toString(buf,0);}
|
||||
@@ -89,8 +87,7 @@ private:
|
||||
|
||||
class Scalar : public Field{
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<Scalar> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const Scalar> const_shared_pointer;
|
||||
POINTER_DEFINITIONS(Scalar);
|
||||
typedef Scalar& reference;
|
||||
typedef const Scalar& const_reference;
|
||||
|
||||
@@ -107,8 +104,7 @@ private:
|
||||
|
||||
class ScalarArray : public Field{
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<ScalarArray> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const ScalarArray> const_shared_pointer;
|
||||
POINTER_DEFINITIONS(ScalarArray);
|
||||
typedef ScalarArray& reference;
|
||||
typedef const ScalarArray& const_reference;
|
||||
|
||||
@@ -125,8 +121,7 @@ private:
|
||||
|
||||
class StructureArray : public Field{
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<StructureArray> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const StructureArray> const_shared_pointer;
|
||||
POINTER_DEFINITIONS(StructureArray);
|
||||
typedef StructureArray& reference;
|
||||
typedef const StructureArray& const_reference;
|
||||
|
||||
@@ -144,8 +139,7 @@ private:
|
||||
|
||||
class Structure : public Field {
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<Structure> shared_pointer;
|
||||
typedef std::tr1::shared_ptr<const Structure> const_shared_pointer;
|
||||
POINTER_DEFINITIONS(Structure);
|
||||
typedef Structure& reference;
|
||||
typedef const Structure& const_reference;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user