22#ifndef Configuration_H_
23#define Configuration_H_
29#include "UniSetTypes.h"
30#include "ObjectIndex.h"
31#include "PassiveTimer.h"
50 static std::string help();
53 Configuration(
int argc,
const char*
const* argv,
const std::string& xmlfile =
"" );
56 Configuration(
int argc,
const char*
const* argv, std::shared_ptr<UniXML> xml );
59 Configuration(
int argc,
const char*
const* argv, std::shared_ptr<ObjectIndex>
oind,
const std::string& xmlfile =
"" );
66 std::string
getField(
const std::string& path)
const noexcept;
68 int getIntField(
const std::string& path)
const noexcept;
70 int getPIntField(
const std::string& path,
int def)
const noexcept;
72 xmlNode* findNode(xmlNode* node,
const std::string& searchnode,
const std::string& name =
"" )
const noexcept;
75 xmlNode* getNode(
const std::string& path)
const noexcept;
78 std::string getProp(xmlNode*,
const std::string& name)
const noexcept;
79 int getIntProp(xmlNode*,
const std::string& name)
const noexcept;
80 int getPIntProp(xmlNode*,
const std::string& name,
int def)
const noexcept;
83 std::string getPropByNodeName(
const std::string& nodename,
const std::string& prop)
const noexcept;
86 int getArgc()
const noexcept;
87 const char*
const* getArgv()
const noexcept;
91 const std::string getNSName()
const noexcept;
94 std::string getRootSection()
const noexcept;
95 std::string getSensorsSection()
const noexcept;
96 std::string getObjectsSection()
const noexcept;
97 std::string getControllersSection()
const noexcept;
98 std::string getServicesSection()
const noexcept;
100 xmlNode* getXMLSensorsSection()
noexcept;
101 xmlNode* getXMLObjectsSection()
noexcept;
102 xmlNode* getXMLControllersSection()
noexcept;
103 xmlNode* getXMLServicesSection()
noexcept;
104 xmlNode* getXMLNodesSection()
noexcept;
108 UniversalIO::IOType getIOType(
const std::string& name )
const noexcept;
111 size_t getCountOfNet()
const noexcept;
112 timeout_t getRepeatTimeout()
const noexcept;
113 size_t getRepeatCount()
const noexcept;
125 const std::string getConfFileName()
const noexcept;
126 std::string getImagesDir()
const noexcept;
129 timeout_t getHeartBeatTime()
const noexcept;
130 timeout_t getNCReadyTimeout()
const noexcept;
131 timeout_t getStartupIgnoreTimeout()
const noexcept;
134 const std::string getConfDir()
const noexcept;
135 const std::string getDataDir()
const noexcept;
136 const std::string getBinDir()
const noexcept;
137 const std::string getLogDir()
const noexcept;
138 const std::string getLockDir()
const noexcept;
139 const std::string getDocDir()
const noexcept;
141 bool isLocalIOR()
const noexcept;
142 bool isTransientIOR()
const noexcept;
143 size_t getHttpResovlerPort()
const noexcept;
146 std::string
getArgParam(
const std::string& name,
const std::string& defval =
"")
const noexcept;
149 std::string
getArg2Param(
const std::string& name,
const std::string& defval,
const std::string& defval2 =
"")
const noexcept;
152 int getArgInt(
const std::string& name,
const std::string& defval =
"")
const noexcept;
155 int getArgPInt(
const std::string& name,
int defval)
const noexcept;
156 int getArgPInt(
const std::string& name,
const std::string& strdefval,
int defval)
const noexcept;
158 xmlNode* initLogStream(
DebugStream& deb,
const std::string& nodename )
noexcept;
159 xmlNode* initLogStream( std::shared_ptr<DebugStream> deb,
const std::string& nodename )
noexcept;
160 xmlNode* initLogStream(
DebugStream* deb,
const std::string& nodename )
noexcept;
162 uniset::ListOfNode::const_iterator listNodesBegin()
const noexcept;
163 uniset::ListOfNode::const_iterator listNodesEnd()
const noexcept;
166 std::shared_ptr<ObjectIndex>
oind;
172 const std::shared_ptr<UniXML>
getConfXML() const noexcept;
174 CORBA::ORB_ptr getORB() const;
175 const CORBA::PolicyList getPolicy() const noexcept;
177 static
bool checkOmniORBendPoint( const
std::
string& endPoint );
182 virtual
void initConfiguration(
int argc, const
char* const* argv);
184 void createNodesList();
187 void initRepSections();
188 std::pair<
std::
string, xmlNode*> getRepSectionName( const
std::
string& sec );
189 void setConfFileName( const
std::
string& fn = "" );
190 void initParameters();
191 void setLocalNode( const
std::
string& nodename );
193 std::
string getPort( const
std::
string& port = "" ) const noexcept;
195 std::
string rootDir = {
"" };
196 std::shared_ptr<UniXML> unixml;
199 const char** _argv = {
nullptr };
201 CORBA::PolicyList policyList;
210 size_t httpResolverPort = { 8008 };
212 uniset::ListOfNode lnodes;
215 std::string secRoot = {
"" };
216 std::string secSensors = {
"" };
217 std::string secObjects = {
"" };
218 std::string secControlles = {
"" };
219 std::string secServices = {
"" };
222 xmlNode* xmlSensorsSec = { 0 };
223 xmlNode* xmlObjectsSec = { 0 };
224 xmlNode* xmlControllersSec = { 0 };
225 xmlNode* xmlServicesSec = { 0 };
226 xmlNode* xmlNodesSec = { 0 };
231 std::string localNodeName = {
"" };
232 std::string fileConfName = {
"" };
233 std::string imagesDir = {
"" };
235 std::string confDir = {
"" };
236 std::string dataDir = {
"" };
237 std::string binDir = {
"" };
238 std::string logDir = {
"" };
239 std::string docDir = {
"" };
240 std::string lockDir = {
"" };
241 bool localIOR = {
false };
242 bool transientIOR = {
false };
244 timeout_t heartbeat_msec = { 3000 };
245 timeout_t ncreadytimeout_msec = { 180000 };
246 timeout_t startupIgnoretimeout_msec = { 5000 };
250 std::shared_ptr<Configuration>
uniset_conf() noexcept;
256 std::shared_ptr<Configuration>
uniset_init(
int argc, const
char* const* argv, const
std::
string& xmlfile = "configure.xml" );
257 std::shared_ptr<Configuration>
uniset_init(
int argc, const
char* const* argv,
std::shared_ptr<UniXML> xml );
262#define uinfo if( uniset::ulog()->debugging(Debug::INFO) ) uniset::ulog()->info()
263#define uwarn if( uniset::ulog()->debugging(Debug::WARN) ) uniset::ulog()->warn()
264#define ucrit if( uniset::ulog()->debugging(Debug::CRIT) ) uniset::ulog()->crit()
265#define ulog1 if( uniset::ulog()->debugging(Debug::LEVEL1) ) uniset::ulog()->level1()
266#define ulog2 if( uniset::ulog()->debugging(Debug::LEVEL2) ) uniset::ulog()->level2()
267#define ulog3 if( uniset::ulog()->debugging(Debug::LEVEL3) ) uniset::ulog()->level3()
268#define ulog4 if( uniset::ulog()->debugging(Debug::LEVEL4) ) uniset::ulog()->level4()
269#define ulog5 if( uniset::ulog()->debugging(Debug::LEVEL5) ) uniset::ulog()->level5()
270#define ulog6 if( uniset::ulog()->debugging(Debug::LEVEL6) ) uniset::ulog()->level6()
271#define ulog7 if( uniset::ulog()->debugging(Debug::LEVEL7) ) uniset::ulog()->level7()
272#define ulog8 if( uniset::ulog()->debugging(Debug::LEVEL8) ) uniset::ulog()->level8()
273#define ulog9 if( uniset::ulog()->debugging(Debug::LEVEL9) ) uniset::ulog()->level9()
274#define ulogsys if( uniset::ulog()->debugging(Debug::SYSTEM) ) uniset::ulog()->system()
275#define ulogrep if( uniset::ulog()->debugging(Debug::REPOSITORY) ) uniset::ulog()->repository()
276#define ulogany uniset::ulog()->any()
Definition DebugStream.h:62
Definition Configuration.h:46
const std::shared_ptr< UniXML > getConfXML() const noexcept
Definition Configuration.cc:1129
size_t countOfNet
Definition Configuration.h:204
std::string getRootDir() const noexcept
Definition Configuration.cc:837
std::string getArgParam(const std::string &name, const std::string &defval="") const noexcept
Definition Configuration.cc:535
std::string getArg2Param(const std::string &name, const std::string &defval, const std::string &defval2="") const noexcept
Definition Configuration.cc:530
ObjectId getDBServer() const noexcept
Definition Configuration.cc:852
std::string getLocalNodeName() const noexcept
Definition Configuration.cc:862
std::string getField(const std::string &path) const noexcept
Получить значение полей с путём path.
Definition Configuration.cc:806
timeout_t repeatTimeout
Definition Configuration.h:208
int getPIntField(const std::string &path, int def) const noexcept
Получить число из поле с путём path (или def, если значение <= 0)
Definition Configuration.cc:818
std::string NSName
Definition Configuration.h:203
int getIntField(const std::string &path) const noexcept
Получить число из поле с путём path.
Definition Configuration.cc:812
int getArgPInt(const std::string &name, int defval) const noexcept
Definition Configuration.cc:545
std::shared_ptr< ObjectIndex > oind
Definition Configuration.h:166
std::shared_ptr< IORFile > iorfile
Definition Configuration.h:169
int getArgInt(const std::string &name, const std::string &defval="") const noexcept
Definition Configuration.cc:540
ObjectId getLocalNode() const noexcept
Definition Configuration.cc:857
size_t repeatCount
Definition Configuration.h:205
Definition Calibration.h:27
std::shared_ptr< Configuration > uniset_init(int argc, const char *const *argv, const std::string &xmlfile="configure.xml")
Definition Configuration.cc:1512
const ObjectId DefaultObjectId
Definition UniSetTypes.h:71
std::shared_ptr< Configuration > uniset_conf() noexcept
Definition Configuration.cc:90
std::shared_ptr< DebugStream > ulog() noexcept
Definition Configuration.cc:80
long ObjectId
Definition UniSetTypes_i.idl:30
Definition UniSetTypes_i.idl:55
Definition UniSetTypes.h:156