Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
bbb8a0fa
Commit
bbb8a0fa
authored
Jan 30, 2014
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Configuration: исправил ошибку со static переменными (конфигураций может быть…
Configuration: исправил ошибку со static переменными (конфигураций может быть много..а это не учитывалось).
parent
1863043e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
24 deletions
+25
-24
Configuration.h
include/Configuration.h
+14
-14
Configuration.cc
src/Various/Configuration.cc
+11
-10
No files found.
include/Configuration.h
View file @
bbb8a0fa
...
...
@@ -91,7 +91,7 @@ namespace UniSetTypes
inline
ObjectId
getDBServer
()
const
{
return
localDBServer
;
}
/*!< получение идентификатора DBServer-а */
inline
ObjectId
getLocalNode
()
const
{
return
localNode
;
}
/*!< получение идентификатора локального узла */
inline
std
::
string
getLocalNodeName
()
const
{
return
localNodeName
;
}
/*!< получение название локального узла */
inline
const
std
::
string
getNSName
()
const
{
return
NSName
;
}
inline
const
std
::
string
getNSName
()
const
{
return
NSName
;
}
// repository
inline
std
::
string
getRootSection
()
const
{
return
secRoot
;
}
...
...
@@ -182,9 +182,9 @@ namespace UniSetTypes
void
setConfFileName
(
const
std
::
string
&
fn
=
""
);
void
initParameters
();
void
setLocalNode
(
const
std
::
string
&
nodename
);
std
::
string
getPort
(
const
std
::
string
&
port
=
""
);
std
::
string
rootDir
;
UniXML
unixml
;
...
...
@@ -192,7 +192,7 @@ namespace UniSetTypes
const
char
*
const
*
_argv
;
CORBA
::
ORB_var
orb
;
CORBA
::
PolicyList
policyList
;
std
::
string
NSName
;
/*!< имя сервиса именования на ланной машине (обычно "NameService") */
unsigned
int
countOfNet
;
/*!< количество резервных каналов */
unsigned
int
repeatCount
;
/*!< количество попыток получить доступ к удаленному объекту
...
...
@@ -210,15 +210,15 @@ namespace UniSetTypes
std
::
string
secServices
;
// xml
static
xmlNode
*
xmlSensorsSec
;
static
xmlNode
*
xmlObjectsSec
;
static
xmlNode
*
xmlControllersSec
;
static
xmlNode
*
xmlServicesSec
;
static
xmlNode
*
xmlNodesSec
;
xmlNode
*
xmlSensorsSec
;
xmlNode
*
xmlObjectsSec
;
xmlNode
*
xmlControllersSec
;
xmlNode
*
xmlServicesSec
;
xmlNode
*
xmlNodesSec
;
ObjectId
localDBServer
;
ObjectId
localNode
;
std
::
string
localNodeName
;
std
::
string
fileConfName
;
std
::
string
imagesDir
;
...
...
@@ -231,21 +231,21 @@ namespace UniSetTypes
std
::
string
lockDir
;
bool
localIOR
;
bool
transientIOR
;
int
heartbeat_msec
;
};
/*! Глобальный указатель на конфигуратор */
extern
Configuration
*
conf
;
/*! Глобальный объект для вывода логов */
extern
DebugStream
ulog
;
// Инициализация UniSetTypes::conf.
// ( учитываются параметры командной строки --confile и --id-from-config )
void
uniset_init
(
int
argc
,
const
char
*
const
*
argv
,
const
std
::
string
&
xmlfile
=
"configure.xml"
);
}
// end of UniSetTypes namespace
// --------------------------------------------------------------------------
// "синтаксический сахар"..для логов
...
...
src/Various/Configuration.cc
View file @
bbb8a0fa
...
...
@@ -161,6 +161,13 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
// PassiveTimer pt(UniSetTimer::WaitUpTime);
ulogsys
<<
"*** configure from file: "
<<
fileConfName
<<
endl
;
// -------------------------------------------------------------------------
xmlSensorsSec
=
0
;
xmlObjectsSec
=
0
;
xmlControllersSec
=
0
;
xmlServicesSec
=
0
;
xmlNodesSec
=
0
;
// -------------------------------------------------------------------------
char
curdir
[
FILENAME_MAX
];
getcwd
(
curdir
,
FILENAME_MAX
);
...
...
@@ -881,17 +888,11 @@ UniSetTypes::ObjectId Configuration::getNodeID( const std::string& name )
}
// -------------------------------------------------------------------------
xmlNode
*
Configuration
::
xmlSensorsSec
=
0
;
xmlNode
*
Configuration
::
xmlObjectsSec
=
0
;
xmlNode
*
Configuration
::
xmlControllersSec
=
0
;
xmlNode
*
Configuration
::
xmlServicesSec
=
0
;
xmlNode
*
Configuration
::
xmlNodesSec
=
0
;
// -------------------------------------------------------------------------
xmlNode
*
Configuration
::
getXMLSensorsSection
()
{
if
(
xmlSensorsSec
)
return
xmlSensorsSec
;
xmlSensorsSec
=
unixml
.
findNode
(
unixml
.
getFirstNode
(),
"sensors"
);
return
xmlSensorsSec
;
}
...
...
@@ -900,7 +901,7 @@ xmlNode* Configuration::getXMLObjectsSection()
{
if
(
xmlObjectsSec
)
return
xmlObjectsSec
;
xmlObjectsSec
=
unixml
.
findNode
(
unixml
.
getFirstNode
(),
"objects"
);
return
xmlObjectsSec
;
}
...
...
@@ -909,7 +910,7 @@ xmlNode* Configuration::getXMLControllersSection()
{
if
(
xmlControllersSec
)
return
xmlControllersSec
;
xmlControllersSec
=
unixml
.
findNode
(
unixml
.
getFirstNode
(),
"controllers"
);
return
xmlControllersSec
;
...
...
@@ -919,7 +920,7 @@ xmlNode* Configuration::getXMLServicesSection()
{
if
(
xmlServicesSec
)
return
xmlServicesSec
;
xmlServicesSec
=
unixml
.
findNode
(
unixml
.
getFirstNode
(),
"services"
);
return
xmlServicesSec
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment