OpcUaCanOpen
CANopen OPC-UA server
OpcServer.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** opcserver.cpp
3 **
4 ** Copyright (c) 2006-2016 Unified Automation GmbH. All rights reserved.
5 **
6 ** Software License Agreement ("SLA") Version 2.5
7 **
8 ** Unless explicitly acquired and licensed from Licensor under another
9 ** license, the contents of this file are subject to the Software License
10 ** Agreement ("SLA") Version 2.5, or subsequent versions
11 ** as allowed by the SLA, and You may not copy or use this file in either
12 ** source code or executable form, except in compliance with the terms and
13 ** conditions of the SLA.
14 **
15 ** All software distributed under the SLA is provided strictly on an
16 ** "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
17 ** AND LICENSOR HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
18 ** LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19 ** PURPOSE, QUIET ENJOYMENT, OR NON-INFRINGEMENT. See the SLA for specific
20 ** language governing rights and limitations under the SLA.
21 **
22 ** The complete license agreement can be found here:
23 ** http://unifiedautomation.com/License/SLA/2.5/
24 **
25 ** Project: C++ OPC Server SDK sample code
26 **
27 ** Description: Main OPC Server object class.
28 **
29 ******************************************************************************/
30 #ifndef MAIN_OPCSERVER_H
31 #define MAIN_OPCSERVER_H
32 
33 #include "uaserverapplication.h"
34 #include "ControlInterface.h"
36 
37 class OpcServerPrivate;
38 class UaServer;
39 
45 class OpcServer: public UaServerApplication
46 {
48 public:
49  // construction / destruction
50  OpcServer();
51  OpcServer(int argc, char* argv[], bool bRunAsService, const UaString &sApplicationName);
52 
53  void setDeviceConfig(UaString sDeviceConfig) {
54  m_sDeviceConfig = sDeviceConfig;
55  }
56 
57  void setApplicationPathConfig(UaString sApplicationPathConfig) {
58  m_sAapplicationPath = sApplicationPathConfig;
59  }
60 
61  void setAutomationNode(AddressSpace::NmBuildingAutomation* pMyNodeManager) { m_pMyNodeManager = pMyNodeManager; }
62 
63  void setTypeCreator(MyNodeManagerNodeSetXmlCreator* pTypeCreator) { m_pTypeCreator= pTypeCreator; }
64 
65  void setControlInterface(std::shared_ptr<UserDevice::ControlInterface> pControlInterface) {
66  m_pControlInterface = pControlInterface;
67  }
68 
69  virtual ~OpcServer();
70 
71  virtual OpcUa_DateTime getBuildDate() const;
72 // void disconnectInterface(); //! disconnect of control interface
73  void closeInterface();
74 
75 protected:
76 
78  virtual UaStatus afterStartUp();
79 
80  std::shared_ptr<UserDevice::ControlInterface> m_pControlInterface;
81 
82 private:
86 };
87 
88 
89 #endif // MAIN_OPCSERVER_H
90 
91