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
1073e8c5
Commit
1073e8c5
authored
Aug 02, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Продолжаю расставлять const, а так же перенос реалиазций в cc-файлы.
parent
593ef135
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
316 additions
and
345 deletions
+316
-345
MySQLInterface.cc
extensions/DBServer-MySQL/MySQLInterface.cc
+4
-4
MySQLInterface.h
extensions/DBServer-MySQL/MySQLInterface.h
+3
-3
PostgreSQLInterface.cc
extensions/DBServer-PostgreSQL/PostgreSQLInterface.cc
+2
-2
PostgreSQLInterface.h
extensions/DBServer-PostgreSQL/PostgreSQLInterface.h
+2
-2
SQLiteInterface.cc
extensions/DBServer-SQLite/SQLiteInterface.cc
+2
-2
SQLiteInterface.h
extensions/DBServer-SQLite/SQLiteInterface.h
+2
-2
SharedMemory.h
extensions/SharedMemory/SharedMemory.h
+1
-1
CommonEventLoop.h
include/CommonEventLoop.h
+1
-1
Configuration.h
include/Configuration.h
+63
-151
DBInterface.h
include/DBInterface.h
+5
-5
DebugStream.h
include/DebugStream.h
+5
-4
IOController.h
include/IOController.h
+3
-3
LT_Object.h
include/LT_Object.h
+4
-6
LogAgregator.h
include/LogAgregator.h
+6
-6
LogReader.h
include/LogReader.h
+1
-1
NCRestorer.h
include/NCRestorer.h
+2
-2
PassiveObject.h
include/PassiveObject.h
+2
-2
PassiveTimer.h
include/PassiveTimer.h
+3
-13
Pulse.h
include/Pulse.h
+2
-2
ThreadCreator.h
include/ThreadCreator.h
+3
-3
UniSetActivator.h
include/UniSetActivator.h
+3
-8
UniSetManager.h
include/UniSetManager.h
+11
-33
UniSetObject.h
include/UniSetObject.h
+21
-60
LogAgregator.cc
src/Log/LogAgregator.cc
+6
-6
LogReader.cc
src/Log/LogReader.cc
+1
-1
ORepHelpers.cc
src/ObjectRepository/ORepHelpers.cc
+2
-2
UniSetActivator.cc
src/ObjectRepository/UniSetActivator.cc
+11
-1
UniSetManager.cc
src/ObjectRepository/UniSetManager.cc
+45
-11
UniSetObject.cc
src/ObjectRepository/UniSetObject.cc
+73
-2
UniSetTypes.cc
src/ObjectRepository/UniSetTypes.cc
+1
-1
CommonEventLoop.cc
src/Processes/CommonEventLoop.cc
+1
-1
NCRestorer_XML.cc
src/Processes/NCRestorer_XML.cc
+1
-1
DBInterface.cc
src/Services/DBInterface.cc
+3
-3
PassiveTimer.cc
src/Timers/PassiveTimer.cc
+16
-0
Configuration.cc
src/Various/Configuration.cc
+0
-0
LT_Object.cc
src/Various/LT_Object.cc
+5
-0
No files found.
extensions/DBServer-MySQL/MySQLInterface.cc
View file @
1073e8c5
...
...
@@ -144,12 +144,12 @@ double MySQLInterface::insert_id()
return
mysql_insert_id
(
mysql
);
}
// -----------------------------------------------------------------------------------------
const
char
*
MySQLInterface
::
gethostinfo
()
const
char
*
MySQLInterface
::
gethostinfo
()
const
{
return
mysql_get_host_info
(
mysql
);
}
// -----------------------------------------------------------------------------------------
bool
MySQLInterface
::
ping
()
bool
MySQLInterface
::
ping
()
const
{
if
(
!
mysql
||
!
connected
)
return
false
;
...
...
@@ -159,7 +159,7 @@ bool MySQLInterface::ping()
return
!
mysql_ping
(
mysql
);
}
// -----------------------------------------------------------------------------------------
bool
MySQLInterface
::
isConnection
()
bool
MySQLInterface
::
isConnection
()
const
{
return
ping
();
//!mysql;
}
...
...
@@ -177,7 +177,7 @@ string MySQLInterface::addslashes( const string& str )
tmp
<<
str
[
i
];
}
return
tmp
.
str
(
);
return
std
::
move
(
tmp
.
str
()
);
}
// -----------------------------------------------------------------------------------------
void
MySQLInterface
::
makeResult
(
DBResult
&
dbres
,
MYSQL_RES
*
myres
,
bool
finalize
)
...
...
extensions/DBServer-MySQL/MySQLInterface.h
View file @
1073e8c5
...
...
@@ -58,17 +58,17 @@ class MySQLInterface:
проверка связи с БД.
в случае отсутсвия попытка восстановить...
*/
virtual
bool
ping
()
override
;
virtual
bool
ping
()
const
override
;
/*! связь с БД установлена (была) */
virtual
bool
isConnection
()
override
;
virtual
bool
isConnection
()
const
override
;
virtual
double
insert_id
()
override
;
virtual
const
std
::
string
error
()
override
;
// *******************
const
char
*
gethostinfo
();
const
char
*
gethostinfo
()
const
;
protected
:
private
:
...
...
extensions/DBServer-PostgreSQL/PostgreSQLInterface.cc
View file @
1073e8c5
...
...
@@ -45,7 +45,7 @@ PostgreSQLInterface::~PostgreSQLInterface()
}
// -----------------------------------------------------------------------------------------
bool
PostgreSQLInterface
::
ping
()
bool
PostgreSQLInterface
::
ping
()
const
{
return
db
&&
db
->
is_open
();
}
...
...
@@ -213,7 +213,7 @@ void PostgreSQLInterface::save_inserted_id( const pqxx::result& res )
last_inserted_id
=
res
[
0
][
0
].
as
<
int
>
();
}
// -----------------------------------------------------------------------------------------
bool
PostgreSQLInterface
::
isConnection
()
bool
PostgreSQLInterface
::
isConnection
()
const
{
return
(
db
&&
db
->
is_open
());
}
...
...
extensions/DBServer-PostgreSQL/PostgreSQLInterface.h
View file @
1073e8c5
...
...
@@ -38,8 +38,8 @@ class PostgreSQLInterface:
const
std
::
string
&
pswd
,
const
std
::
string
&
dbname
,
unsigned
int
port
=
5432
)
override
;
virtual
bool
close
()
override
;
virtual
bool
isConnection
()
override
;
virtual
bool
ping
()
override
;
// проверка доступности БД
virtual
bool
isConnection
()
const
override
;
virtual
bool
ping
()
const
override
;
virtual
DBResult
query
(
const
std
::
string
&
q
)
override
;
virtual
const
std
::
string
lastQuery
()
override
;
...
...
extensions/DBServer-SQLite/SQLiteInterface.cc
View file @
1073e8c5
...
...
@@ -51,7 +51,7 @@ SQLiteInterface::~SQLiteInterface()
}
// -----------------------------------------------------------------------------------------
bool
SQLiteInterface
::
ping
()
bool
SQLiteInterface
::
ping
()
const
{
return
db
&&
(
sqlite3_db_status
(
db
,
0
,
NULL
,
NULL
,
0
)
==
SQLITE_OK
);
}
...
...
@@ -219,7 +219,7 @@ double SQLiteInterface::insert_id()
return
sqlite3_last_insert_rowid
(
db
);
}
// -----------------------------------------------------------------------------------------
bool
SQLiteInterface
::
isConnection
()
bool
SQLiteInterface
::
isConnection
()
const
{
return
connected
;
}
...
...
extensions/DBServer-SQLite/SQLiteInterface.h
View file @
1073e8c5
...
...
@@ -90,8 +90,8 @@ class SQLiteInterface:
virtual
bool
connect
(
const
std
::
string
&
param
)
override
;
bool
connect
(
const
std
::
string
&
dbfile
,
bool
create
);
virtual
bool
close
()
override
;
virtual
bool
isConnection
()
override
;
virtual
bool
ping
()
override
;
// проверка доступности БД
virtual
bool
isConnection
()
const
override
;
virtual
bool
ping
()
const
override
;
void
setOperationTimeout
(
timeout_t
msec
);
inline
timeout_t
getOperationTimeout
()
...
...
extensions/SharedMemory/SharedMemory.h
View file @
1073e8c5
...
...
@@ -391,7 +391,7 @@ class SharedMemory:
typedef
sigc
::
signal
<
void
,
const
HistoryInfo
&>
HistorySlot
;
HistorySlot
signal_history
();
/*!< сигнал о срабатывании условий "сброса" дампа истории */
inline
int
getHistoryStep
()
inline
int
getHistoryStep
()
const
{
return
histSaveTime
;
/*!< период между точками "дампа", мсек */
}
...
...
include/CommonEventLoop.h
View file @
1073e8c5
...
...
@@ -47,7 +47,7 @@ class CommonEventLoop
CommonEventLoop
();
~
CommonEventLoop
();
bool
evIsActive
();
bool
evIsActive
()
const
;
/*! \return TRUE - если всё удалось. return актуален только для случая когда thread = true */
bool
evrun
(
EvWatcher
*
w
,
bool
thread
=
true
);
...
...
include/Configuration.h
View file @
1073e8c5
...
...
@@ -46,6 +46,8 @@ namespace UniSetTypes
public
:
virtual
~
Configuration
();
static
std
::
ostream
&
help
(
std
::
ostream
&
os
);
/*! конфигурирование xml-файлом ( предпочтительный способ ) */
Configuration
(
int
argc
,
const
char
*
const
*
argv
,
const
std
::
string
&
xmlfile
=
""
);
...
...
@@ -57,72 +59,39 @@ namespace UniSetTypes
const
std
::
string
&
fileConf
,
UniSetTypes
::
ObjectInfo
*
objectsMap
);
/// Получить значение полей с путём path
std
::
string
getField
(
const
std
::
string
&
path
);
std
::
string
getField
(
const
std
::
string
&
path
)
const
;
/// Получить число из поле с путём path
int
getIntField
(
const
std
::
string
&
path
);
int
getIntField
(
const
std
::
string
&
path
)
const
;
/// Получить число из поле с путём path (или def, если значение <= 0)
int
getPIntField
(
const
std
::
string
&
path
,
int
def
);
int
getPIntField
(
const
std
::
string
&
path
,
int
def
)
const
;
xmlNode
*
findNode
(
xmlNode
*
node
,
const
std
::
string
&
searchnode
,
const
std
::
string
&
name
=
""
);
xmlNode
*
findNode
(
xmlNode
*
node
,
const
std
::
string
&
searchnode
,
const
std
::
string
&
name
=
""
)
const
;
// Получить узел
xmlNode
*
getNode
(
const
std
::
string
&
path
);
xmlNode
*
getNode
(
const
std
::
string
&
path
)
const
;
// Получить указанное свойство пути
std
::
string
getProp
(
xmlNode
*
,
const
std
::
string
&
name
);
int
getIntProp
(
xmlNode
*
,
const
std
::
string
&
name
);
int
getPIntProp
(
xmlNode
*
,
const
std
::
string
&
name
,
int
def
);
// Получить указанное свойство по имени узла
std
::
string
getPropByNodeName
(
const
std
::
string
&
nodename
,
const
std
::
string
&
prop
);
std
::
string
getProp
(
xmlNode
*
,
const
std
::
string
&
name
)
const
;
int
getIntProp
(
xmlNode
*
,
const
std
::
string
&
name
)
const
;
int
getPIntProp
(
xmlNode
*
,
const
std
::
string
&
name
,
int
def
)
const
;
static
std
::
ostream
&
help
(
std
::
ostream
&
os
);
// Получить указанное свойство по имени узла
std
::
string
getPropByNodeName
(
const
std
::
string
&
nodename
,
const
std
::
string
&
prop
)
const
;
std
::
string
getRootDir
();
/*!< Получение каталога, в котором находится выполняющаяся программа */
inline
int
getArgc
()
const
{
return
_argc
;
}
inline
const
char
*
const
*
getArgv
()
const
{
return
_argv
;
}
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
;
}
std
::
string
getRootDir
()
const
;
/*!< Получение каталога, в котором находится выполняющаяся программа */
int
getArgc
()
const
;
const
char
*
const
*
getArgv
()
const
;
ObjectId
getDBServer
()
const
;
ObjectId
getLocalNode
()
const
;
std
::
string
getLocalNodeName
()
const
;
const
std
::
string
getNSName
()
const
;
// repository
inline
std
::
string
getRootSection
()
const
{
return
secRoot
;
}
inline
std
::
string
getSensorsSection
()
const
{
return
secSensors
;
}
inline
std
::
string
getObjectsSection
()
const
{
return
secObjects
;
}
inline
std
::
string
getControllersSection
()
const
{
return
secControlles
;
}
inline
std
::
string
getServicesSection
()
const
{
return
secServices
;
}
std
::
string
getRootSection
()
const
;
std
::
string
getSensorsSection
()
const
;
std
::
string
getObjectsSection
()
const
;
std
::
string
getControllersSection
()
const
;
std
::
string
getServicesSection
()
const
;
// xml
xmlNode
*
getXMLSensorsSection
();
xmlNode
*
getXMLObjectsSection
();
...
...
@@ -130,101 +99,53 @@ namespace UniSetTypes
xmlNode
*
getXMLServicesSection
();
xmlNode
*
getXMLNodesSection
();
xmlNode
*
getXMLObjectNode
(
UniSetTypes
::
ObjectId
);
UniversalIO
::
IOType
getIOType
(
UniSetTypes
::
ObjectId
);
UniversalIO
::
IOType
getIOType
(
const
std
::
string
&
name
);
UniversalIO
::
IOType
getIOType
(
UniSetTypes
::
ObjectId
)
const
;
UniversalIO
::
IOType
getIOType
(
const
std
::
string
&
name
)
const
;
// net
inline
size_t
getCountOfNet
()
const
{
return
countOfNet
;
}
inline
size_t
getRepeatTimeout
()
const
{
return
repeatTimeout
;
}
inline
size_t
getRepeatCount
()
const
{
return
repeatCount
;
}
UniSetTypes
::
ObjectId
getSensorID
(
const
std
::
string
&
name
);
UniSetTypes
::
ObjectId
getControllerID
(
const
std
::
string
&
name
);
UniSetTypes
::
ObjectId
getObjectID
(
const
std
::
string
&
name
);
UniSetTypes
::
ObjectId
getServiceID
(
const
std
::
string
&
name
);
UniSetTypes
::
ObjectId
getNodeID
(
const
std
::
string
&
name
);
inline
const
std
::
string
getConfFileName
()
const
{
return
fileConfName
;
}
inline
std
::
string
getImagesDir
()
const
{
return
imagesDir
;
// временно
}
inline
timeout_t
getHeartBeatTime
()
{
return
heartbeat_msec
;
}
size_t
getCountOfNet
()
const
;
size_t
getRepeatTimeout
()
const
;
size_t
getRepeatCount
()
const
;
UniSetTypes
::
ObjectId
getSensorID
(
const
std
::
string
&
name
)
const
;
UniSetTypes
::
ObjectId
getControllerID
(
const
std
::
string
&
name
)
const
;
UniSetTypes
::
ObjectId
getObjectID
(
const
std
::
string
&
name
)
const
;
UniSetTypes
::
ObjectId
getServiceID
(
const
std
::
string
&
name
)
const
;
UniSetTypes
::
ObjectId
getNodeID
(
const
std
::
string
&
name
)
const
;
const
std
::
string
getConfFileName
()
const
;
std
::
string
getImagesDir
()
const
;
timeout_t
getHeartBeatTime
()
const
;
// dirs
inline
const
std
::
string
getConfDir
()
const
{
return
confDir
;
}
inline
const
std
::
string
getDataDir
()
const
{
return
dataDir
;
}
inline
const
std
::
string
getBinDir
()
const
{
return
binDir
;
}
inline
const
std
::
string
getLogDir
()
const
{
return
logDir
;
}
inline
const
std
::
string
getLockDir
()
const
{
return
lockDir
;
}
inline
const
std
::
string
getDocDir
()
const
{
return
docDir
;
}
inline
bool
isLocalIOR
()
const
{
return
localIOR
;
}
inline
bool
isTransientIOR
()
const
{
return
transientIOR
;
}
const
std
::
string
getConfDir
()
const
;
const
std
::
string
getDataDir
()
const
;
const
std
::
string
getBinDir
()
const
;
const
std
::
string
getLogDir
()
const
;
const
std
::
string
getLockDir
()
const
;
const
std
::
string
getDocDir
()
const
;
bool
isLocalIOR
()
const
;
bool
isTransientIOR
()
const
;
/*! получить значение указанного параметра, или значение по умолчанию */
std
::
string
getArgParam
(
const
std
::
string
&
name
,
const
std
::
string
&
defval
=
""
);
std
::
string
getArgParam
(
const
std
::
string
&
name
,
const
std
::
string
&
defval
=
""
)
const
;
/*! получить значение, если пустое, то defval, если defval="" return defval2 */
std
::
string
getArg2Param
(
const
std
::
string
&
name
,
const
std
::
string
&
defval
,
const
std
::
string
&
defval2
=
""
);
std
::
string
getArg2Param
(
const
std
::
string
&
name
,
const
std
::
string
&
defval
,
const
std
::
string
&
defval2
=
""
)
const
;
/*! получить числовое значение параметра, если не число, то 0. Если параметра нет, используется значение defval */
int
getArgInt
(
const
std
::
string
&
name
,
const
std
::
string
&
defval
=
""
);
int
getArgInt
(
const
std
::
string
&
name
,
const
std
::
string
&
defval
=
""
)
const
;
/*! получить числовое значение параметра, но если оно не положительное, вернуть defval */
int
getArgPInt
(
const
std
::
string
&
name
,
int
defval
);
int
getArgPInt
(
const
std
::
string
&
name
,
const
std
::
string
&
strdefval
,
int
defval
);
int
getArgPInt
(
const
std
::
string
&
name
,
int
defval
)
const
;
int
getArgPInt
(
const
std
::
string
&
name
,
const
std
::
string
&
strdefval
,
int
defval
)
const
;
xmlNode
*
initLogStream
(
DebugStream
&
deb
,
const
std
::
string
&
nodename
);
xmlNode
*
initLogStream
(
std
::
shared_ptr
<
DebugStream
>
deb
,
const
std
::
string
&
nodename
);
xmlNode
*
initLogStream
(
DebugStream
*
deb
,
const
std
::
string
&
nodename
);
UniSetTypes
::
ListOfNode
::
const_iterator
listNodesBegin
()
{
return
lnodes
.
begin
();
}
inline
UniSetTypes
::
ListOfNode
::
const_iterator
listNodesEnd
()
{
return
lnodes
.
end
();
}
UniSetTypes
::
ListOfNode
::
const_iterator
listNodesBegin
();
UniSetTypes
::
ListOfNode
::
const_iterator
listNodesEnd
();
/*! интерфейс к карте объектов */
std
::
shared_ptr
<
ObjectIndex
>
oind
;
...
...
@@ -233,19 +154,10 @@ namespace UniSetTypes
std
::
shared_ptr
<
IORFile
>
iorfile
;
/*! указатель на конфигурационный xml */
inline
const
std
::
shared_ptr
<
UniXML
>
getConfXML
()
const
{
return
unixml
;
}
inline
CORBA
::
ORB_ptr
getORB
()
const
{
return
CORBA
::
ORB
::
_duplicate
(
orb
);
}
inline
const
CORBA
::
PolicyList
getPolicy
()
const
{
return
policyList
;
}
const
std
::
shared_ptr
<
UniXML
>
getConfXML
()
const
;
CORBA
::
ORB_ptr
getORB
()
const
;
const
CORBA
::
PolicyList
getPolicy
()
const
;
protected
:
Configuration
();
...
...
@@ -261,7 +173,7 @@ namespace UniSetTypes
void
initParameters
();
void
setLocalNode
(
const
std
::
string
&
nodename
);
std
::
string
getPort
(
const
std
::
string
&
port
=
""
);
std
::
string
getPort
(
const
std
::
string
&
port
=
""
)
const
;
std
::
string
rootDir
=
{
""
};
std
::
shared_ptr
<
UniXML
>
unixml
;
...
...
include/DBInterface.h
View file @
1073e8c5
...
...
@@ -20,8 +20,8 @@ class DBInterface
// Функция подключения к БД, параметры подключения зависят от типа БД
virtual
bool
connect
(
const
std
::
string
&
param
)
=
0
;
virtual
bool
close
()
=
0
;
virtual
bool
isConnection
()
=
0
;
virtual
bool
ping
()
=
0
;
// проверка доступности БД
virtual
bool
isConnection
()
const
=
0
;
virtual
bool
ping
()
const
=
0
;
// проверка доступности БД
virtual
DBResult
query
(
const
std
::
string
&
q
)
=
0
;
virtual
const
std
::
string
lastQuery
()
=
0
;
...
...
@@ -57,9 +57,9 @@ class DBResult
ROW
&
row
();
iterator
begin
();
iterator
end
();
operator
bool
();
size_t
size
();
bool
empty
();
operator
bool
()
const
;
size_t
size
()
const
;
bool
empty
()
const
;
// ----------------------------------------------------------------------------
// ROW
...
...
include/DebugStream.h
View file @
1073e8c5
...
...
@@ -131,7 +131,7 @@ class DebugStream : public std::ostream
/// Sets the debugstreams' logfile to f.
virtual
void
logFile
(
const
std
::
string
&
f
,
bool
truncate
=
false
);
inline
std
::
string
getLogFile
()
inline
std
::
string
getLogFile
()
const
{
return
fname
;
}
...
...
@@ -143,7 +143,7 @@ class DebugStream : public std::ostream
}
// включена ли запись лог-файла
inline
bool
isOnLogFile
()
inline
bool
isOnLogFile
()
const
{
return
isWriteLogFile
;
}
...
...
@@ -226,7 +226,7 @@ class DebugStream : public std::ostream
return operator()(Debug::LEVEL); \
} \
\
inline bool is_##FNAME() \
inline bool is_##FNAME()
const
\
{ return debugging(Debug::LEVEL); }
DMANIP
(
level1
,
LEVEL1
)
...
...
@@ -259,7 +259,8 @@ class DebugStream : public std::ostream
{
logname
=
n
;
}
inline
std
::
string
getLogName
()
inline
std
::
string
getLogName
()
const
{
return
logname
;
}
...
...
include/IOController.h
View file @
1073e8c5
...
...
@@ -134,7 +134,7 @@ class IOController:
{
return
ioList
.
find
(
k
);
}
inline
int
ioCount
()
inline
int
ioCount
()
const
{
return
ioList
.
size
();
}
...
...
@@ -250,11 +250,11 @@ class IOController:
// функии проверки текущего значения
bool
checkIOFilters
(
std
::
shared_ptr
<
USensorInfo
>&
ai
,
CORBA
::
Long
&
newvalue
,
UniSetTypes
::
ObjectId
sup_id
);
inline
bool
iofiltersEmpty
()
inline
bool
iofiltersEmpty
()
const
{
return
iofilters
.
empty
();
}
inline
int
iodiltersSize
()
inline
int
iodiltersSize
()
const
{
return
iofilters
.
size
();
}
...
...
include/LT_Object.h
View file @
1073e8c5
...
...
@@ -135,6 +135,9 @@ class LT_Object
protected
:
/*! пользовательская функция для вывода названия таймера */
virtual
std
::
string
getTimerName
(
int
id
);
/*! Информация о таймере */
struct
TimerInfo
{
...
...
@@ -193,14 +196,9 @@ class LT_Object
TimersList
getTimersList
();
/*! пользовательская функция для вывода названия таймера */
virtual
std
::
string
getTimerName
(
int
id
)
{
return
""
;
}
private
:
TimersList
tlst
;
/*! замок для блокирования совместного доступа к cписку таймеров */
UniSetTypes
::
uniset_rwmutex
lstMutex
;
PassiveTimer
tmLast
;
...
...
include/LogAgregator.h
View file @
1073e8c5
...
...
@@ -155,11 +155,11 @@ class LogAgregator:
// найти лог..
std
::
shared_ptr
<
DebugStream
>
getLog
(
const
std
::
string
&
logname
);
bool
logExist
(
std
::
shared_ptr
<
DebugStream
>&
l
);
bool
logExist
(
std
::
shared_ptr
<
DebugStream
>&
l
)
const
;
struct
iLog
{
iLog
(
std
::
shared_ptr
<
DebugStream
>&
l
,
const
std
::
string
&
nm
)
:
log
(
l
),
name
(
nm
)
{}
iLog
(
const
std
::
shared_ptr
<
DebugStream
>&
l
,
const
std
::
string
&
nm
)
:
log
(
l
),
name
(
nm
)
{}
std
::
shared_ptr
<
DebugStream
>
log
;
std
::
string
name
;
...
...
@@ -170,8 +170,8 @@ class LogAgregator:
}
};
std
::
list
<
iLog
>
getLogList
();
std
::
list
<
iLog
>
getLogList
(
const
std
::
string
&
regexp_str
);
std
::
list
<
iLog
>
getLogList
()
const
;
std
::
list
<
iLog
>
getLogList
(
const
std
::
string
&
regexp_str
)
const
;
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
LogAgregator
&
la
);
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
std
::
shared_ptr
<
LogAgregator
>
la
);
...
...
@@ -187,13 +187,13 @@ class LogAgregator:
void
addLogAgregator
(
std
::
shared_ptr
<
LogAgregator
>
la
,
const
std
::
string
&
lname
);
// поиск лога по составному логу.."agregator/agregator2/.../logname"
std
::
shared_ptr
<
DebugStream
>
findLog
(
const
std
::
string
&
lname
);
std
::
shared_ptr
<
DebugStream
>
findLog
(
const
std
::
string
&
lname
)
const
;
// вывод в виде "дерева"
std
::
ostream
&
printTree
(
std
::
ostream
&
os
,
const
std
::
string
&
g_tab
=
""
);
// получить список с именами (длинными) и с указателями на логи
std
::
list
<
iLog
>
makeLogNameList
(
const
std
::
string
&
prefix
);
std
::
list
<
iLog
>
makeLogNameList
(
const
std
::
string
&
prefix
)
const
;
private
:
typedef
std
::
unordered_map
<
std
::
string
,
std
::
shared_ptr
<
DebugStream
>>
LogMap
;
...
...
include/LogReader.h
View file @
1073e8c5
...
...
@@ -48,7 +48,7 @@ class LogReader
void
readlogs
(
const
std
::
string
&
addr
,
ost
::
tpport_t
port
,
LogServerTypes
::
Command
c
=
LogServerTypes
::
cmdNOP
,
const
std
::
string
logfilter
=
""
,
bool
verbose
=
false
);
bool
isConnection
();
bool
isConnection
()
const
;
inline
void
setReadCount
(
unsigned
int
n
)
{
...
...
include/NCRestorer.h
View file @
1073e8c5
...
...
@@ -135,7 +135,7 @@ class NCRestorer_XML:
void
setThresholdsFilter
(
const
std
::
string
&
filterField
,
const
std
::
string
&
filterValue
=
""
);
bool
setFileName
(
const
std
::
string
&
file
,
bool
create
);
inline
std
::
string
getFileName
()
inline
std
::
string
getFileName
()
const
{
return
fname
;
}
...
...
@@ -163,7 +163,7 @@ class NCRestorer_XML:
protected
:
bool
check_thresholds_item
(
UniXML
::
iterator
&
it
);
bool
check_thresholds_item
(
UniXML
::
iterator
&
it
)
const
;
void
read_consumers
(
const
std
::
shared_ptr
<
UniXML
>&
xml
,
xmlNode
*
node
,
std
::
shared_ptr
<
NCRestorer_XML
::
SInfo
>&
inf
,
IONotifyController
*
ic
);
void
read_list
(
const
std
::
shared_ptr
<
UniXML
>&
xml
,
xmlNode
*
node
,
IONotifyController
*
ic
);
void
read_thresholds
(
const
std
::
shared_ptr
<
UniXML
>&
xml
,
xmlNode
*
node
,
IONotifyController
*
ic
);
...
...
include/PassiveObject.h
View file @
1073e8c5
...
...
@@ -47,11 +47,11 @@ class PassiveObject
void
setID
(
UniSetTypes
::
ObjectId
id
);
void
init
(
ProxyManager
*
mngr
);
inline
UniSetTypes
::
ObjectId
getId
()
inline
UniSetTypes
::
ObjectId
getId
()
const
{
return
id
;
}
inline
std
::
string
getName
()
inline
std
::
string
getName
()
const
{
return
myname
;
}
...
...
include/PassiveTimer.h
View file @
1073e8c5
...
...
@@ -45,24 +45,14 @@ class UniSetTimer
virtual
timeout_t
getCurrent
()
const
=
0
;
/*!< получить текущее значение таймера */
virtual
timeout_t
getInterval
()
const
=
0
;
/*!< получить интервал, на который установлен таймер, в мс */
timeout_t
getLeft
(
timeout_t
timeout
)
/*!< получить время, которое остается от timeout после прошествия времени getCurrent() */
{
timeout_t
ct
=
getCurrent
();
if
(
timeout
<=
ct
)
return
0
;
return
timeout
-
ct
;
}
timeout_t
getLeft
(
timeout_t
timeout
)
const
;
/*!< получить время, которое остается от timeout после прошествия времени getCurrent() */
// объявлены не чисто виртуальными т.к.
// некоторые классы могут не иметь подобных
// свойств.
virtual
bool
wait
(
timeout_t
timeMS
)
{
return
0
;
/*!< заснуть ожидая наступления времени */
}
virtual
void
terminate
()
{}
/*!< прервать работу таймера */
virtual
bool
wait
(
timeout_t
timeMS
);
/*!< заснуть ожидая наступления времени */
virtual
void
terminate
()
{}
/*!< прервать работу таймера */
/*! завершить работу таймера */
virtual
void
stop
()
...
...
include/Pulse.h
View file @
1073e8c5
...
...
@@ -116,11 +116,11 @@ class Pulse
}
inline
timeout_t
getT1
()
inline
timeout_t
getT1
()
const
{
return
t1_msec
;
}
inline
timeout_t
getT0
()
inline
timeout_t
getT0
()
const
{
return
t0_msec
;
}
...
...
include/ThreadCreator.h
View file @
1073e8c5
...
...
@@ -93,7 +93,7 @@ class ThreadCreator:
ThreadCreator
(
ThreadMaster
*
m
,
Action
a
);
~
ThreadCreator
();
inline
pid_t
getTID
()
inline
pid_t
getTID
()
const
{
return
pid
;
}
...
...
@@ -102,7 +102,7 @@ class ThreadCreator:
int
setPriority
(
int
prior
);
/*! \return < 0 - fail */
int
getPriority
();
int
getPriority
()
const
;
void
stop
();
...
...
@@ -211,7 +211,7 @@ int ThreadCreator<ThreadMaster>::setPriority( int prior )
}
//----------------------------------------------------------------------------------------
template
<
class
ThreadMaster
>
int
ThreadCreator
<
ThreadMaster
>::
getPriority
()
int
ThreadCreator
<
ThreadMaster
>::
getPriority
()
const
{
return
getpriority
(
PRIO_PROCESS
,
pid
);
}
...
...
include/UniSetActivator.h
View file @
1073e8c5
...
...
@@ -57,10 +57,7 @@ class UniSetActivator:
static
UniSetActivatorPtr
Instance
(
const
UniSetTypes
::
ObjectId
id
=
UniSetTypes
::
DefaultObjectId
);
void
Destroy
();
std
::
shared_ptr
<
UniSetActivator
>
get_aptr
()
{
return
std
::
dynamic_pointer_cast
<
UniSetActivator
>
(
get_ptr
());
}
std
::
shared_ptr
<
UniSetActivator
>
get_aptr
();
// ------------------------------------
virtual
~
UniSetActivator
();
...
...
@@ -90,16 +87,14 @@ class UniSetActivator:
virtual
void
work
();
inline
CORBA
::
ORB_ptr
getORB
()
{
return
orb
;
}
CORBA
::
ORB_ptr
getORB
();
virtual
void
sysCommand
(
const
UniSetTypes
::
SystemMessage
*
sm
)
override
;
// уносим в protected, т.к. Activator должен быть только один..
UniSetActivator
();
UniSetActivator
(
const
UniSetTypes
::
ObjectId
id
);
static
std
::
shared_ptr
<
UniSetActivator
>
inst
;
private
:
...
...
include/UniSetManager.h
View file @
1073e8c5
...
...
@@ -60,10 +60,7 @@ class UniSetManager:
UniSetManager
(
const
std
::
string
&
name
,
const
std
::
string
&
section
);
virtual
~
UniSetManager
();
std
::
shared_ptr
<
UniSetManager
>
get_mptr
()
{
return
std
::
dynamic_pointer_cast
<
UniSetManager
>
(
get_ptr
());
}
std
::
shared_ptr
<
UniSetManager
>
get_mptr
();
virtual
UniSetTypes
::
ObjectType
getType
()
override
{
...
...
@@ -88,37 +85,18 @@ class UniSetManager:
*/
const
std
::
shared_ptr
<
UniSetObject
>
itemO
(
const
UniSetTypes
::
ObjectId
id
);
// Функции для аботы со списками подчиненных объектов
inline
UniSetManagerList
::
const_iterator
beginMList
()
{
return
mlist
.
begin
();
}
// Функции для работы со списками подчиненных объектов
// ---------------
UniSetManagerList
::
const_iterator
beginMList
();
UniSetManagerList
::
const_iterator
endMList
();
ObjectsList
::
const_iterator
beginOList
();
ObjectsList
::
const_iterator
endOList
();
inline
UniSetManagerList
::
const_iterator
endMList
()
{
return
mlist
.
end
();
}
inline
ObjectsList
::
const_iterator
beginOList
()
{
return
olist
.
begin
();
}
size_t
objectsCount
()
const
;
// количество подчиненных объектов
// ---------------
inline
ObjectsList
::
const_iterator
endOList
()
{
return
olist
.
end
();
}
int
objectsCount
();
// количество подчиненных объектов
PortableServer
::
POA_ptr
getPOA
()
{
return
PortableServer
::
POA
::
_duplicate
(
poa
);
}
PortableServer
::
POAManager_ptr
getPOAManager
()
{
return
PortableServer
::
POAManager
::
_duplicate
(
pman
);
}
PortableServer
::
POA_ptr
getPOA
();
PortableServer
::
POAManager_ptr
getPOAManager
();
protected
:
...
...
include/UniSetObject.h
View file @
1073e8c5
...
...
@@ -81,50 +81,36 @@ class UniSetObject:
UniSetObject
();
virtual
~
UniSetObject
();
std
::
shared_ptr
<
UniSetObject
>
get_ptr
()
{
return
shared_from_this
();
}
std
::
shared_ptr
<
UniSetObject
>
get_ptr
();
// Функции объявленные в IDL
virtual
CORBA
::
Boolean
exist
()
override
;
virtual
UniSetTypes
::
ObjectId
getId
()
override
{
return
myid
;
}
inline
const
UniSetTypes
::
ObjectId
getId
()
const
{
return
myid
;
}
inline
std
::
string
getName
()
{
return
myname
;
}
virtual
UniSetTypes
::
ObjectId
getId
()
override
;
const
UniSetTypes
::
ObjectId
getId
()
const
;
std
::
string
getName
()
const
;
virtual
UniSetTypes
::
ObjectType
getType
()
override
{
return
UniSetTypes
::
ObjectType
(
"UniSetObject"
);
}
virtual
UniSetTypes
::
SimpleInfo
*
getInfo
(
::
CORBA
::
Long
userparam
=
0
)
override
;
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
UniSetObject
&
obj
);
//! поместить сообщение в очередь
virtual
void
push
(
const
UniSetTypes
::
TransportMessage
&
msg
)
override
;
// -------------- вспомогательные --------------
/*! получить ссылку (на себя) */
inline
UniSetTypes
::
ObjectPtr
getRef
()
const
{
UniSetTypes
::
uniset_rwmutex_rlock
lock
(
refmutex
);
return
(
UniSetTypes
::
ObjectPtr
)
CORBA
::
Object
::
_duplicate
(
oref
);
}
UniSetTypes
::
ObjectPtr
getRef
()
const
;
/*! заказ таймера (вынесена в public, хотя должна была бы быть в protected */
virtual
timeout_t
askTimer
(
UniSetTypes
::
TimerId
timerid
,
timeout_t
timeMS
,
clock_t
ticks
=
-
1
,
UniSetTypes
::
Message
::
Priority
p
=
UniSetTypes
::
Message
::
High
)
override
;
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
UniSetObject
&
obj
);
protected
:
std
::
shared_ptr
<
UInterface
>
ui
;
/*!< универсальный интерфейс для работы с другими процессами */
...
...
@@ -153,19 +139,13 @@ class UniSetObject:
size_t
countMessages
();
/*! количество потерянных сообщений */
size_t
getCountOfLostMessages
();
size_t
getCountOfLostMessages
()
const
;
//! Активизация объекта (переопределяется для необходимых действий после активизации)
virtual
bool
activateObject
()
{
return
true
;
}
virtual
bool
activateObject
();
//! Деактивиция объекта (переопределяется для необходимых действий перед деактивацией)
virtual
bool
deactivateObject
()
{
return
true
;
}
virtual
bool
deactivateObject
();
/*! Функция вызываемая при приходе сигнала завершения или прерывания процесса. Переопределив ее можно
* выполнять специфичные для процесса действия по обработке сигнала.
...
...
@@ -174,28 +154,18 @@ class UniSetObject:
*/
virtual
void
sigterm
(
int
signo
);
inline
void
terminate
()
{
deactivate
();
}
void
terminate
();
// управление созданием потока обработки сообщений -------
/*! запрет(разрешение) создания потока для обработки сообщений */
inline
void
thread
(
bool
create
)
{
threadcreate
=
create
;
}
void
thread
(
bool
create
);
/*! отключение потока обработки сообщений */
inline
void
offThread
()
{
threadcreate
=
false
;
}
void
offThread
();
/*! включение потока обработки сообщений */
inline
void
onThread
()
{
threadcreate
=
true
;
}
void
onThread
();
/*! функция вызываемая из потока */
virtual
void
callback
();
...
...
@@ -211,22 +181,13 @@ class UniSetObject:
void
setMaxSizeOfMessageQueue
(
size_t
s
);
/*! получить размер очереди сообщений */
inline
size_t
getMaxSizeOfMessageQueue
()
{
return
mqueueMedium
.
getMaxSizeOfMessageQueue
();
}
size_t
getMaxSizeOfMessageQueue
()
const
;
/*! проверка "активности" объекта */
inline
bool
isActive
()
{
return
active
;
}
bool
isActive
()
const
;
/*! false - завершить работу потока обработки сообщений */
inline
void
setActive
(
bool
set
)
{
active
=
set
;
}
void
setActive
(
bool
set
);
private
:
...
...
src/Log/LogAgregator.cc
View file @
1073e8c5
...
...
@@ -253,7 +253,7 @@ std::vector<std::string> LogAgregator::splitFirst( const std::string& lname, con
return
std
::
move
(
v
);
}
// -------------------------------------------------------------------------
bool
LogAgregator
::
logExist
(
std
::
shared_ptr
<
DebugStream
>&
log
)
bool
LogAgregator
::
logExist
(
std
::
shared_ptr
<
DebugStream
>&
log
)
const
{
for
(
const
auto
&
l
:
lmap
)
{
...
...
@@ -273,7 +273,7 @@ bool LogAgregator::logExist( std::shared_ptr<DebugStream>& log )
return
false
;
}
// -------------------------------------------------------------------------
std
::
shared_ptr
<
DebugStream
>
LogAgregator
::
findLog
(
const
std
::
string
&
lname
)
std
::
shared_ptr
<
DebugStream
>
LogAgregator
::
findLog
(
const
std
::
string
&
lname
)
const
{
auto
v
=
splitFirst
(
lname
,
sep
);
...
...
@@ -300,7 +300,7 @@ std::shared_ptr<DebugStream> LogAgregator::findLog( const std::string& lname )
return
ag
->
findLog
(
v
[
1
]);
// рекурсия
}
// -------------------------------------------------------------------------
std
::
list
<
LogAgregator
::
iLog
>
LogAgregator
::
getLogList
(
const
std
::
string
&
regex_str
)
std
::
list
<
LogAgregator
::
iLog
>
LogAgregator
::
getLogList
(
const
std
::
string
&
regex_str
)
const
{
std
::
list
<
LogAgregator
::
iLog
>
l
;
...
...
@@ -326,7 +326,7 @@ std::list<LogAgregator::iLog> LogAgregator::getLogList( const std::string& regex
return
std
::
move
(
l
);
}
// -------------------------------------------------------------------------
std
::
list
<
LogAgregator
::
iLog
>
LogAgregator
::
getLogList
()
std
::
list
<
LogAgregator
::
iLog
>
LogAgregator
::
getLogList
()
const
{
std
::
list
<
LogAgregator
::
iLog
>
lst
=
makeLogNameList
(
""
);
lst
.
sort
([](
const
LogAgregator
::
iLog
&
a
,
const
LogAgregator
::
iLog
&
b
)
...
...
@@ -336,7 +336,7 @@ std::list<LogAgregator::iLog> LogAgregator::getLogList()
return
std
::
move
(
lst
);
}
// -------------------------------------------------------------------------
std
::
list
<
LogAgregator
::
iLog
>
LogAgregator
::
makeLogNameList
(
const
std
::
string
&
prefix
)
std
::
list
<
LogAgregator
::
iLog
>
LogAgregator
::
makeLogNameList
(
const
std
::
string
&
prefix
)
const
{
std
::
list
<
LogAgregator
::
iLog
>
lst
;
...
...
@@ -355,7 +355,7 @@ std::list<LogAgregator::iLog> LogAgregator::makeLogNameList( const std::string&
lst
.
splice
(
lst
.
end
(),
ag
->
makeLogNameList
(
p2
));
else
{
std
::
string
nm
(
p2
+
l
.
second
->
getLogName
());
const
std
::
string
nm
(
p2
+
l
.
second
->
getLogName
());
LogAgregator
::
iLog
il
(
l
.
second
,
std
::
move
(
nm
)
);
lst
.
push_back
(
std
::
move
(
il
)
);
}
...
...
src/Log/LogReader.cc
View file @
1073e8c5
...
...
@@ -127,7 +127,7 @@ void LogReader::disconnect()
tcp
=
0
;
}
// -------------------------------------------------------------------------
bool
LogReader
::
isConnection
()
bool
LogReader
::
isConnection
()
const
{
return
tcp
&&
tcp
->
isConnected
();
}
...
...
src/ObjectRepository/ORepHelpers.cc
View file @
1073e8c5
...
...
@@ -231,7 +231,7 @@ namespace ORepHelpers
{
using
namespace
UniSetTypes
;
for
(
unsigned
in
t
i
=
0
;
i
<
str
.
length
();
i
++
)
for
(
size_
t
i
=
0
;
i
<
str
.
length
();
i
++
)
{
for
(
unsigned
int
k
=
0
;
k
<
sizeof
(
BadSymbols
);
k
++
)
{
...
...
@@ -248,7 +248,7 @@ namespace ORepHelpers
{
string
bad
=
""
;
for
(
unsigned
int
i
=
0
;
i
<
sizeof
(
UniSetTypes
::
BadSymbols
);
i
++
)
for
(
size_t
i
=
0
;
i
<
sizeof
(
UniSetTypes
::
BadSymbols
);
i
++
)
{
bad
+=
"'"
;
bad
+=
UniSetTypes
::
BadSymbols
[
i
];
...
...
src/ObjectRepository/UniSetActivator.cc
View file @
1073e8c5
...
...
@@ -125,7 +125,7 @@ static pid_t g_stacktrace_proc_pid = 0; // pid процесса делающег
// выделение специального стека заранее
// +60 - это на всякие переменные при обработке stack trace и т.п.
static
char
g_stack_body
[(
MAXFRAMES
+
60
)
*
FUNCNAMESIZE
];
static
char
trace_buf
[
10000
];
//
static char trace_buf[10000];
static
stack_t
g_sigseg_stack
;
static
void
on_stacktrace_timeout
();
// поток для защиты от зависания "процесса создания stack trace"
// ------------------------------------------------------------------------------------------
...
...
@@ -498,6 +498,11 @@ void UniSetActivator::Destroy()
inst
.
reset
();
}
// ---------------------------------------------------------------------------
std
::
shared_ptr
<
UniSetActivator
>
UniSetActivator
::
get_aptr
()
{
return
std
::
dynamic_pointer_cast
<
UniSetActivator
>
(
get_ptr
());
}
// ---------------------------------------------------------------------------
UniSetActivator
::
UniSetActivator
(
const
ObjectId
id
)
:
UniSetManager
(
id
),
omDestroy
(
false
)
...
...
@@ -740,6 +745,11 @@ void UniSetActivator::work()
}
}
// ------------------------------------------------------------------------------------------
CORBA
::
ORB_ptr
UniSetActivator
::
getORB
()
{
return
orb
;
}
// ------------------------------------------------------------------------------------------
void
UniSetActivator
::
sysCommand
(
const
UniSetTypes
::
SystemMessage
*
sm
)
{
switch
(
sm
->
command
)
...
...
src/ObjectRepository/UniSetManager.cc
View file @
1073e8c5
...
...
@@ -118,6 +118,11 @@ UniSetManager::~UniSetManager()
mlist
.
clear
();
}
// ------------------------------------------------------------------------------------------
std
::
shared_ptr
<
UniSetManager
>
UniSetManager
::
get_mptr
()
{
return
std
::
dynamic_pointer_cast
<
UniSetManager
>
(
get_ptr
());
}
// ------------------------------------------------------------------------------------------
void
UniSetManager
::
initPOA
(
const
std
::
weak_ptr
<
UniSetManager
>&
rmngr
)
{
auto
m
=
rmngr
.
lock
();
...
...
@@ -499,17 +504,6 @@ const std::shared_ptr<UniSetObject> UniSetManager::itemO( const ObjectId id )
// ------------------------------------------------------------------------------------------
int
UniSetManager
::
objectsCount
()
{
int
res
(
olist
.
size
()
+
mlist
.
size
()
);
for
(
auto
i
:
mlist
)
res
+=
i
->
objectsCount
();
return
res
;
}
// ------------------------------------------------------------------------------------------
int
UniSetManager
::
getObjectsInfo
(
const
std
::
shared_ptr
<
UniSetManager
>&
mngr
,
SimpleInfoSeq
*
seq
,
int
begin
,
const
long
uplimit
,
CORBA
::
Long
userparam
)
{
...
...
@@ -600,3 +594,43 @@ std::ostream& operator<<(std::ostream& os, UniSetManager::OManagerCommand& cmd )
return
os
<<
"unkwnown"
;
}
// ------------------------------------------------------------------------------------------
UniSetManagerList
::
const_iterator
UniSetManager
::
beginMList
()
{
return
mlist
.
begin
();
}
// ------------------------------------------------------------------------------------------
UniSetManagerList
::
const_iterator
UniSetManager
::
endMList
()
{
return
mlist
.
end
();
}
// ------------------------------------------------------------------------------------------
ObjectsList
::
const_iterator
UniSetManager
::
beginOList
()
{
return
olist
.
begin
();
}
// ------------------------------------------------------------------------------------------
ObjectsList
::
const_iterator
UniSetManager
::
endOList
()
{
return
olist
.
end
();
}
// ------------------------------------------------------------------------------------------
size_t
UniSetManager
::
objectsCount
()
const
{
size_t
res
=
olist
.
size
()
+
mlist
.
size
();
for
(
const
auto
&
i
:
mlist
)
res
+=
i
->
objectsCount
();
return
res
;
}
// ------------------------------------------------------------------------------------------
PortableServer
::
POA_ptr
UniSetManager
::
getPOA
()
{
return
PortableServer
::
POA
::
_duplicate
(
poa
);
}
// ------------------------------------------------------------------------------------------
PortableServer
::
POAManager_ptr
UniSetManager
::
getPOAManager
()
{
return
PortableServer
::
POAManager
::
_duplicate
(
pman
);
}
// ------------------------------------------------------------------------------------------
src/ObjectRepository/UniSetObject.cc
View file @
1073e8c5
...
...
@@ -119,6 +119,11 @@ UniSetObject::~UniSetObject()
{
}
// ------------------------------------------------------------------------------------------
std
::
shared_ptr
<
UniSetObject
>
UniSetObject
::
get_ptr
()
{
return
shared_from_this
();
}
// ------------------------------------------------------------------------------------------
void
UniSetObject
::
initObject
()
{
a_working
=
ATOMIC_VAR_INIT
(
0
);
...
...
@@ -163,13 +168,28 @@ void UniSetObject::setID( UniSetTypes::ObjectId id )
ui
->
initBackId
(
myid
);
}
// ------------------------------------------------------------------------------------------
void
UniSetObject
::
setMaxSizeOfMessageQueue
(
size_t
s
)
void
UniSetObject
::
setMaxSizeOfMessageQueue
(
size_t
s
)
{
mqueueMedium
.
setMaxSizeOfMessageQueue
(
s
);
mqueueLow
.
setMaxSizeOfMessageQueue
(
s
);
mqueueHi
.
setMaxSizeOfMessageQueue
(
s
);
}
// ------------------------------------------------------------------------------------------
size_t
UniSetObject
::
getMaxSizeOfMessageQueue
()
const
{
return
mqueueMedium
.
getMaxSizeOfMessageQueue
();
}
// ------------------------------------------------------------------------------------------
bool
UniSetObject
::
isActive
()
const
{
return
active
;
}
// ------------------------------------------------------------------------------------------
void
UniSetObject
::
setActive
(
bool
set
)
{
active
=
set
;
}
// ------------------------------------------------------------------------------------------
/*!
* \param vm - указатель на структуру, которая заполняется если есть сообщение
* \return Возвращает \a true если сообщение есть, и \a false если нет
...
...
@@ -310,6 +330,21 @@ CORBA::Boolean UniSetObject::exist()
return
true
;
}
// ------------------------------------------------------------------------------------------
ObjectId
UniSetObject
::
getId
()
{
return
myid
;
}
// ------------------------------------------------------------------------------------------
const
ObjectId
UniSetObject
::
getId
()
const
{
return
myid
;
}
// ------------------------------------------------------------------------------------------
string
UniSetObject
::
getName
()
const
{
return
myname
;
}
// ------------------------------------------------------------------------------------------
void
UniSetObject
::
termWaiting
()
{
if
(
tmr
)
...
...
@@ -338,22 +373,58 @@ void UniSetObject::push( const TransportMessage& tm )
termWaiting
();
}
// ------------------------------------------------------------------------------------------
ObjectPtr
UniSetObject
::
getRef
()
const
{
UniSetTypes
::
uniset_rwmutex_rlock
lock
(
refmutex
);
return
(
UniSetTypes
::
ObjectPtr
)
CORBA
::
Object
::
_duplicate
(
oref
);
}
// ------------------------------------------------------------------------------------------
size_t
UniSetObject
::
countMessages
()
{
return
(
mqueueMedium
.
size
()
+
mqueueLow
.
size
()
+
mqueueHi
.
size
());
}
// ------------------------------------------------------------------------------------------
size_t
UniSetObject
::
getCountOfLostMessages
()
size_t
UniSetObject
::
getCountOfLostMessages
()
const
{
return
(
mqueueMedium
.
getCountOfLostMessages
()
+
mqueueLow
.
getCountOfLostMessages
()
+
mqueueHi
.
getCountOfLostMessages
()
);
}
// ------------------------------------------------------------------------------------------
bool
UniSetObject
::
activateObject
()
{
return
true
;
}
// ------------------------------------------------------------------------------------------
bool
UniSetObject
::
deactivateObject
()
{
return
true
;
}
// ------------------------------------------------------------------------------------------
void
UniSetObject
::
sigterm
(
int
signo
)
{
}
// ------------------------------------------------------------------------------------------
void
UniSetObject
::
terminate
()
{
deactivate
();
}
// ------------------------------------------------------------------------------------------
void
UniSetObject
::
thread
(
bool
create
)
{
threadcreate
=
create
;
}
// ------------------------------------------------------------------------------------------
void
UniSetObject
::
offThread
()
{
threadcreate
=
false
;
}
// ------------------------------------------------------------------------------------------
void
UniSetObject
::
onThread
()
{
threadcreate
=
true
;
}
// ------------------------------------------------------------------------------------------
bool
UniSetObject
::
deactivate
()
{
if
(
!
isActive
()
)
...
...
src/ObjectRepository/UniSetTypes.cc
View file @
1073e8c5
...
...
@@ -267,7 +267,7 @@ std::vector<std::string> UniSetTypes::explode_str( const string& str, char sep )
// ------------------------------------------------------------------------------------------
bool
UniSetTypes
::
is_digit
(
const
std
::
string
&
s
)
{
for
(
auto
c
:
s
)
for
(
const
auto
&
c
:
s
)
{
if
(
!
isdigit
(
c
)
)
return
false
;
...
...
src/Processes/CommonEventLoop.cc
View file @
1073e8c5
...
...
@@ -76,7 +76,7 @@ bool CommonEventLoop::evrun(EvWatcher* w, bool thread )
return
true
;
}
// ---------------------------------------------------------------------------
bool
CommonEventLoop
::
evIsActive
()
bool
CommonEventLoop
::
evIsActive
()
const
{
return
isrunning
;
}
...
...
src/Processes/NCRestorer_XML.cc
View file @
1073e8c5
...
...
@@ -510,7 +510,7 @@ bool NCRestorer_XML::getThresholdInfo( const std::shared_ptr<UniXML>& xml, xmlNo
return
true
;
}
// ------------------------------------------------------------------------------------------
bool
NCRestorer_XML
::
check_thresholds_item
(
UniXML
::
iterator
&
it
)
bool
NCRestorer_XML
::
check_thresholds_item
(
UniXML
::
iterator
&
it
)
const
{
return
UniSetTypes
::
check_filter
(
it
,
t_filterField
,
t_filterValue
);
}
...
...
src/Services/DBInterface.cc
View file @
1073e8c5
...
...
@@ -61,17 +61,17 @@ DBResult::iterator DBResult::end()
return
row_
.
end
();
}
// ----------------------------------------------------------------------------
DBResult
::
operator
bool
()
DBResult
::
operator
bool
()
const
{
return
!
row_
.
empty
();
}
// ----------------------------------------------------------------------------
size_t
DBResult
::
size
()
size_t
DBResult
::
size
()
const
{
return
row_
.
size
();
}
// ----------------------------------------------------------------------------
bool
DBResult
::
empty
()
bool
DBResult
::
empty
()
const
{
return
row_
.
empty
();
}
...
...
src/Timers/PassiveTimer.cc
View file @
1073e8c5
...
...
@@ -85,3 +85,19 @@ void PassiveTimer::terminate()
t_msec
=
WaitUpTime
;
}
//------------------------------------------------------------------------------
timeout_t
UniSetTimer
::
getLeft
(
timeout_t
timeout
)
const
{
timeout_t
ct
=
getCurrent
();
if
(
timeout
<=
ct
)
return
0
;
return
timeout
-
ct
;
}
//------------------------------------------------------------------------------
bool
UniSetTimer
::
wait
(
timeout_t
timeMS
)
{
return
false
;
}
//------------------------------------------------------------------------------
src/Various/Configuration.cc
View file @
1073e8c5
This diff is collapsed.
Click to expand it.
src/Various/LT_Object.cc
View file @
1073e8c5
...
...
@@ -158,6 +158,11 @@ LT_Object::TimersList LT_Object::getTimersList()
return
std
::
move
(
lst
);
}
// ------------------------------------------------------------------------------------------
string
LT_Object
::
getTimerName
(
int
id
)
{
return
""
;
}
// ------------------------------------------------------------------------------------------
timeout_t
LT_Object
::
askTimer
(
UniSetTypes
::
TimerId
timerid
,
timeout_t
timeMS
,
clock_t
ticks
,
UniSetTypes
::
Message
::
Priority
p
)
{
...
...
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