OpcUaCanOpen
CANopen OPC-UA server
InterfaceUserDataBase.h
Go to the documentation of this file.
1 #ifndef __INTERFACEUSERDATABASE_H__
2 #define __INTERFACEUSERDATABASE_H__
3 
4 #include "uabasenodes.h"
5 #include "uadatavalue.h"
6 #include "UserDeviceStruct.h"
7 
8 #include <iostream>
9 
10 namespace UserDevice
11 {
18  {
20 
21  public:
29  InterfaceUserDataBase(pUserDeviceStruct *parent,::xsd::cxx::tree::type *conf,UaNode *pAS,OpcUa_UInt code) :
30  UserDeviceStruct(parent,conf,pAS,code)
31  {
32  //if (parent) {
33  // m_pSharedMutex = static_cast<InterfaceUserDataBase *>(*parent->pPoint). ->getShareMutex();
34  // m_pSharedMutex->addReference();
35  //}
36  //else {
37  // m_pSharedMutex = new UaMutexRefCounted();
38  //}
39  }
40 
42  //void lock() {
43  // m_pSharedMutex->lock();
44  //}
45 
47  //void unlock() {
48  // m_pSharedMutex->unlock();
49  //}
50 
52  //::UaMutexRefCounted* getShareMutex() { return m_pSharedMutex; }
53 
54  //void releaseMutex()
55  //{
56  // m_pSharedMutex->releaseReference();
57  // if (m_pSharedMutex->referenceCount() == 0)
58  // {
59  // m_pSharedMutex = NULL;
60  // }
61  //}
62 
63  //void addReference()
64  //{
65  // if (m_pSharedMutex)
66  // {
67  // m_pSharedMutex->addReference();
68  // }
69  //}
70 
71  //OpcUa_Int32 countMutex()
72  //{
73  // return m_pSharedMutex->referenceCount();
74  //}
75 
76 
77 
79  virtual ~InterfaceUserDataBase(void)
80  {
81  //if ( m_pSharedMutex )
82  //{
83  // // Release our local reference
84  // m_pSharedMutex->releaseReference();
85  // m_pSharedMutex = NULL;
86  //}
87 
88  };
89 
94  virtual UaStatus getDeviceMessage(OpcUa_UInt32 code) = 0;
95 
101  virtual UaStatus sendDeviceMessage(OpcUa_UInt32 code, UaDataValue *value = 0) = 0;
102 
108  virtual UaStatus connectCode(OpcUa_UInt32 code, ::xsd::cxx::tree::type *conf, UaNode *node) = 0;
109  virtual UaVariant getPropertyValue(OpcUa_UInt32 code, ::xsd::cxx::tree::type *conf) = 0;
110  //protected:
111  // UaMutexRefCounted* m_pSharedMutex; //! shared mutex should use to protect operation on device
112  };
113 
114 }
115 #endif