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
055a718a
Commit
055a718a
authored
Jan 12, 2015
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(UniSetManager): Переделан интерфейс, оставлены только две функции
add и remove.. (вместо addObject,addManager,removeObject,removeManager).
parent
ab0cf843
Show whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
113 additions
and
127 deletions
+113
-127
TODO
TODO
+6
-0
admin.cc
Utilities/Admin/admin.cc
+0
-0
main.cc
Utilities/NullController/main.cc
+1
-1
smonitor.cc
Utilities/SMonit/smonitor.cc
+1
-1
ctl-cpp-main-alone.xsl
Utilities/codegen/ctl-cpp-main-alone.xsl
+1
-1
ctl-cpp-main.xsl
Utilities/codegen/ctl-cpp-main.xsl
+1
-1
skel-main.cc
Utilities/codegen/skel-main.cc
+1
-1
main.cc
extensions/DBServer-MySQL/main.cc
+1
-1
main.cc
extensions/DBServer-SQLite/main.cc
+1
-1
iocontrol.cc
extensions/IOControl/iocontrol.cc
+1
-1
plogicproc.cc
extensions/LogicProcessor/plogicproc.cc
+1
-1
main.cc
extensions/ModbusMaster/main.cc
+1
-1
multi-main.cc
extensions/ModbusMaster/multi-main.cc
+1
-1
rtuexchange.cc
extensions/ModbusMaster/rtuexchange.cc
+1
-1
run_test_mbtcpmaster.cc
extensions/ModbusMaster/tests/run_test_mbtcpmaster.cc
+2
-2
run_test_mbtcpmultimaster.cc
extensions/ModbusMaster/tests/run_test_mbtcpmultimaster.cc
+2
-2
mbslave.cc
extensions/ModbusSlave/mbslave.cc
+1
-1
mbtcp-multislave.cc
extensions/ModbusSlave/mbtcp-multislave.cc
+1
-1
tests_with_sm.cc
extensions/ModbusSlave/tests/tests_with_sm.cc
+2
-2
main.cc
extensions/RRDServer/main.cc
+1
-1
main.cc
extensions/SMDBServer/main.cc
+6
-7
smemory.cc
extensions/SharedMemory/smemory.cc
+2
-2
smemory-plus.cc
extensions/SharedMemoryPlus/smemory-plus.cc
+6
-6
tests_with_sm.cc
extensions/UNetUDP/tests/tests_with_sm.cc
+2
-2
unetexchange.cc
extensions/UNetUDP/unetexchange.cc
+1
-1
uninet.cc
extensions/UniNetwork/uninet.cc
+1
-1
UObject_SK.h
extensions/include/UObject_SK.h
+2
-1
UObject_SK.cc
extensions/lib/UObject_SK.cc
+18
-10
smemory-test.cc
extensions/tests/SMemoryTest/smemory-test.cc
+4
-4
tests_with_sm.cc
extensions/tests/tests_with_sm.cc
+1
-1
UniSetActivator.h
include/UniSetActivator.h
+2
-29
UniSetManager.h
include/UniSetManager.h
+12
-14
UniSetActivator.cc
src/ObjectRepository/UniSetActivator.cc
+4
-19
UniSetManager.cc
src/ObjectRepository/UniSetManager.cc
+25
-9
UniSetObject.cc
src/ObjectRepository/UniSetObject.cc
+0
-0
No files found.
TODO
View file @
055a718a
...
@@ -40,6 +40,8 @@ Version 2.0
...
@@ -40,6 +40,8 @@ Version 2.0
- ТЕСТЫ! ТЕСТЫ! ТЕСТЫ!
- ТЕСТЫ! ТЕСТЫ! ТЕСТЫ!
- Перевести взаимодействие PassiveObject <--> ProxyManager на shared_ptr (или weak_ptr).
Version 2.1
Version 2.1
============
============
...
@@ -48,6 +50,10 @@ Version 2.1
...
@@ -48,6 +50,10 @@ Version 2.1
- IOBase: возможность задавать свою формулу преобразования входного сигнала (помимо калибровки)..
- IOBase: возможность задавать свою формулу преобразования входного сигнала (помимо калибровки)..
- переписать систему инициализации и работы между UniSetActivator,UniSetManager и UniSetObject-ами
(уменьшить количество функций (связность) и определится с кто отвечает за удаление объекта и т.п.)
version 3
version 3
=========
=========
...
...
Utilities/Admin/admin.cc
View file @
055a718a
Utilities/NullController/main.cc
View file @
055a718a
...
@@ -73,7 +73,7 @@ int main(int argc, char** argv)
...
@@ -73,7 +73,7 @@ int main(int argc, char** argv)
NullController
nc
(
ID
,
askfile
,
s_field
,
s_fvalue
,
c_field
,
c_fvalue
,
dbDumping
);
NullController
nc
(
ID
,
askfile
,
s_field
,
s_fvalue
,
c_field
,
c_fvalue
,
dbDumping
);
UniSetActivatorPtr
act
=
UniSetActivator
::
Instance
();
UniSetActivatorPtr
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
nc
.
get_ptr
()
);
act
->
add
(
nc
.
get_ptr
()
);
act
->
run
(
false
);
act
->
run
(
false
);
return
0
;
return
0
;
}
}
...
...
Utilities/SMonit/smonitor.cc
View file @
055a718a
...
@@ -36,7 +36,7 @@ int main( int argc, const char **argv )
...
@@ -36,7 +36,7 @@ int main( int argc, const char **argv )
UniSetActivatorPtr
act
=
UniSetActivator
::
Instance
();
UniSetActivatorPtr
act
=
UniSetActivator
::
Instance
();
SMonitor
tp
(
ID
);
SMonitor
tp
(
ID
);
act
->
add
Object
(
tp
.
get_ptr
());
act
->
add
(
tp
.
get_ptr
());
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
Utilities/codegen/ctl-cpp-main-alone.xsl
View file @
055a718a
...
@@ -73,7 +73,7 @@ int main( int argc,char* argv[] )
...
@@ -73,7 +73,7 @@ int main( int argc,char* argv[] )
obj.mylog.logFile( logname.c_str() );
obj.mylog.logFile( logname.c_str() );
auto act = UniSetActivator::Instance();
auto act = UniSetActivator::Instance();
act-
>
add
Object(static_cast
<
class UniSetObject*
>
(
&
obj
));
act-
>
add
(obj.get_ptr(
));
SystemMessage sm(SystemMessage::StartUp);
SystemMessage sm(SystemMessage::StartUp);
act-
>
broadcast( sm.transport_msg() );
act-
>
broadcast( sm.transport_msg() );
...
...
Utilities/codegen/ctl-cpp-main.xsl
View file @
055a718a
...
@@ -81,7 +81,7 @@ int main( int argc, const char** argv )
...
@@ -81,7 +81,7 @@ int main( int argc, const char** argv )
</xsl:if>
</xsl:if>
auto act = UniSetActivator::Instance();
auto act = UniSetActivator::Instance();
act-
>
add
Object(static_cast
<
class UniSetObject*
>
(
&
obj
));
act-
>
add
(obj.get_ptr(
));
SystemMessage sm(SystemMessage::StartUp);
SystemMessage sm(SystemMessage::StartUp);
act-
>
broadcast( sm.transport_msg() );
act-
>
broadcast( sm.transport_msg() );
...
...
Utilities/codegen/skel-main.cc
View file @
055a718a
...
@@ -26,7 +26,7 @@ int main( int argc, const char **argv )
...
@@ -26,7 +26,7 @@ int main( int argc, const char **argv )
}
}
Skel
o
(
"Skel"
,
cnode
);
Skel
o
(
"Skel"
,
cnode
);
act
.
add
Object
(
static_cast
<
UniSetObject
*>
(
&
o
)
);
act
.
add
(
o
.
get_ptr
()
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
.
broadcast
(
sm
.
transport_msg
()
);
act
.
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/DBServer-MySQL/main.cc
View file @
055a718a
...
@@ -54,7 +54,7 @@ int main(int argc, char** argv)
...
@@ -54,7 +54,7 @@ int main(int argc, char** argv)
DBServer_MySQL
dbs
(
ID
);
DBServer_MySQL
dbs
(
ID
);
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
dbs
.
get_ptr
());
act
->
add
(
dbs
.
get_ptr
());
act
->
run
(
false
);
act
->
run
(
false
);
}
}
catch
(
Exception
&
ex
)
catch
(
Exception
&
ex
)
...
...
extensions/DBServer-SQLite/main.cc
View file @
055a718a
...
@@ -55,7 +55,7 @@ int main(int argc, char** argv)
...
@@ -55,7 +55,7 @@ int main(int argc, char** argv)
DBServer_SQLite
dbs
(
ID
);
DBServer_SQLite
dbs
(
ID
);
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
dbs
.
get_ptr
());
act
->
add
(
dbs
.
get_ptr
());
act
->
run
(
false
);
act
->
run
(
false
);
}
}
catch
(
Exception
&
ex
)
catch
(
Exception
&
ex
)
...
...
extensions/IOControl/iocontrol.cc
View file @
055a718a
...
@@ -53,7 +53,7 @@ int main(int argc, const char **argv)
...
@@ -53,7 +53,7 @@ int main(int argc, const char **argv)
}
}
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
ic
);
act
->
add
(
ic
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/LogicProcessor/plogicproc.cc
View file @
055a718a
...
@@ -71,7 +71,7 @@ int main(int argc, const char **argv)
...
@@ -71,7 +71,7 @@ int main(int argc, const char **argv)
PassiveLProcessor
plc
(
schema
,
ID
,
shmID
);
PassiveLProcessor
plc
(
schema
,
ID
,
shmID
);
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
plc
.
get_ptr
());
act
->
add
(
plc
.
get_ptr
());
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/ModbusMaster/main.cc
View file @
055a718a
...
@@ -59,7 +59,7 @@ int main( int argc, const char** argv )
...
@@ -59,7 +59,7 @@ int main( int argc, const char** argv )
}
}
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
mb
);
act
->
add
(
mb
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/ModbusMaster/multi-main.cc
View file @
055a718a
...
@@ -58,7 +58,7 @@ int main( int argc, const char** argv )
...
@@ -58,7 +58,7 @@ int main( int argc, const char** argv )
}
}
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
mb
);
act
->
add
(
mb
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/ModbusMaster/rtuexchange.cc
View file @
055a718a
...
@@ -57,7 +57,7 @@ int main( int argc, char** argv )
...
@@ -57,7 +57,7 @@ int main( int argc, char** argv )
}
}
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
rs
);
act
->
add
(
rs
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/ModbusMaster/tests/run_test_mbtcpmaster.cc
View file @
055a718a
...
@@ -47,8 +47,8 @@ int main(int argc, char* argv[] )
...
@@ -47,8 +47,8 @@ int main(int argc, char* argv[] )
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
shm
);
act
->
add
(
shm
);
act
->
add
Object
(
mb
);
act
->
add
(
mb
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/ModbusMaster/tests/run_test_mbtcpmultimaster.cc
View file @
055a718a
...
@@ -47,8 +47,8 @@ int main(int argc, char* argv[] )
...
@@ -47,8 +47,8 @@ int main(int argc, char* argv[] )
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
shm
);
act
->
add
(
shm
);
act
->
add
Object
(
mb
);
act
->
add
(
mb
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/ModbusSlave/mbslave.cc
View file @
055a718a
...
@@ -63,7 +63,7 @@ int main(int argc, const char **argv)
...
@@ -63,7 +63,7 @@ int main(int argc, const char **argv)
}
}
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
s
);
act
->
add
(
s
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/ModbusSlave/mbtcp-multislave.cc
View file @
055a718a
...
@@ -63,7 +63,7 @@ int main(int argc, const char **argv)
...
@@ -63,7 +63,7 @@ int main(int argc, const char **argv)
}
}
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
s
);
act
->
add
(
s
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/ModbusSlave/tests/tests_with_sm.cc
View file @
055a718a
...
@@ -46,8 +46,8 @@ int main(int argc, char* argv[] )
...
@@ -46,8 +46,8 @@ int main(int argc, char* argv[] )
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
shm
);
act
->
add
(
shm
);
act
->
add
Object
(
mbs
);
act
->
add
(
mbs
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/RRDServer/main.cc
View file @
055a718a
...
@@ -59,7 +59,7 @@ int main( int argc, const char** argv )
...
@@ -59,7 +59,7 @@ int main( int argc, const char** argv )
}
}
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
db
);
act
->
add
(
db
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/SMDBServer/main.cc
View file @
055a718a
...
@@ -23,8 +23,7 @@ int main( int argc, const char** argv )
...
@@ -23,8 +23,7 @@ int main( int argc, const char** argv )
try
try
{
{
string
confile
=
UniSetTypes
::
getArgParam
(
"--confile"
,
argc
,
argv
,
"configure.xml"
);
auto
conf
=
uniset_init
(
argc
,
argv
,
confile
);
conf
=
new
Configuration
(
argc
,
argv
,
confile
);
string
logfilename
(
conf
->
getArgParam
(
"--smdbserver-logfile"
));
string
logfilename
(
conf
->
getArgParam
(
"--smdbserver-logfile"
));
if
(
logfilename
.
empty
()
)
if
(
logfilename
.
empty
()
)
...
@@ -51,24 +50,24 @@ int main( int argc, const char** argv )
...
@@ -51,24 +50,24 @@ int main( int argc, const char** argv )
return
1
;
return
1
;
}
}
SMDBServer
*
db
=
SMDBServer
::
init_smdbserver
(
argc
,
argv
,
shmID
);
auto
db
=
SMDBServer
::
init_smdbserver
(
argc
,
argv
,
shmID
);
if
(
!
db
)
if
(
!
db
)
{
{
dcrit
<<
"(smdbserver): init не прошёл..."
<<
endl
;
dcrit
<<
"(smdbserver): init не прошёл..."
<<
endl
;
return
1
;
return
1
;
}
}
UniSetActivator
act
;
auto
act
=
UniSetActivator
::
Instance
()
;
act
.
addObject
(
static_cast
<
class
UniSetObject
*>
(
db
)
);
act
->
add
(
db
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
.
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
ulog
<<
"
\n\n\n
"
;
ulog
<<
"
\n\n\n
"
;
ulog
<<
"(main): -------------- SMDBServer START -------------------------
\n\n
"
;
ulog
<<
"(main): -------------- SMDBServer START -------------------------
\n\n
"
;
dlog
<<
"
\n\n\n
"
;
dlog
<<
"
\n\n\n
"
;
dlog
<<
"(main): -------------- SMDBServer START -------------------------
\n\n
"
;
dlog
<<
"(main): -------------- SMDBServer START -------------------------
\n\n
"
;
act
.
run
(
false
);
act
->
run
(
false
);
return
0
;
return
0
;
}
}
catch
(
Exception
&
ex
)
catch
(
Exception
&
ex
)
...
...
extensions/SharedMemory/smemory.cc
View file @
055a718a
...
@@ -33,9 +33,9 @@ int main(int argc, const char **argv)
...
@@ -33,9 +33,9 @@ int main(int argc, const char **argv)
if
(
!
shm
)
if
(
!
shm
)
return
1
;
return
1
;
UniSetActivatorPtr
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
shm
);
// ->get_ptr()
);
act
->
add
(
shm
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
run
(
false
);
act
->
run
(
false
);
...
...
extensions/SharedMemoryPlus/smemory-plus.cc
View file @
055a718a
...
@@ -83,7 +83,7 @@ int main( int argc, const char **argv )
...
@@ -83,7 +83,7 @@ int main( int argc, const char **argv )
if
(
!
shm
)
if
(
!
shm
)
return
1
;
return
1
;
act
->
add
Manager
(
shm
);
act
->
add
(
shm
);
#ifdef UNISET_ENABLE_IO
#ifdef UNISET_ENABLE_IO
// ------------ IOControl ----------------
// ------------ IOControl ----------------
...
@@ -113,7 +113,7 @@ int main( int argc, const char **argv )
...
@@ -113,7 +113,7 @@ int main( int argc, const char **argv )
if
(
io_thr
==
NULL
)
if
(
io_thr
==
NULL
)
return
1
;
return
1
;
act
->
add
Object
(
ic
);
act
->
add
(
ic
);
lst_iothr
.
push_back
(
io_thr
);
lst_iothr
.
push_back
(
io_thr
);
}
}
}
}
...
@@ -139,7 +139,7 @@ int main( int argc, const char **argv )
...
@@ -139,7 +139,7 @@ int main( int argc, const char **argv )
if
(
!
rtu
)
if
(
!
rtu
)
return
1
;
return
1
;
act
->
add
Object
(
rtu
);
act
->
add
(
rtu
);
}
}
}
}
// ------------- MBSlave --------------
// ------------- MBSlave --------------
...
@@ -163,7 +163,7 @@ int main( int argc, const char **argv )
...
@@ -163,7 +163,7 @@ int main( int argc, const char **argv )
if
(
!
mbs
)
if
(
!
mbs
)
return
1
;
return
1
;
act
->
add
Object
(
mbs
);
act
->
add
(
mbs
);
}
}
}
}
...
@@ -189,7 +189,7 @@ int main( int argc, const char **argv )
...
@@ -189,7 +189,7 @@ int main( int argc, const char **argv )
if
(
!
mbm1
)
if
(
!
mbm1
)
return
1
;
return
1
;
act
->
add
Object
(
mbm1
);
act
->
add
(
mbm1
);
}
}
}
}
// ------------- UNetUDP --------------
// ------------- UNetUDP --------------
...
@@ -203,7 +203,7 @@ int main( int argc, const char **argv )
...
@@ -203,7 +203,7 @@ int main( int argc, const char **argv )
if
(
dlog
.
is_info
()
)
if
(
dlog
.
is_info
()
)
dlog
.
info
()
<<
"(smemory-plus): add UNetExchnage.."
<<
endl
;
dlog
.
info
()
<<
"(smemory-plus): add UNetExchnage.."
<<
endl
;
act
->
add
Object
(
unet
);
act
->
add
(
unet
);
}
}
// ---------------------------------------
// ---------------------------------------
// попытка решить вопрос с "зомби" процессами
// попытка решить вопрос с "зомби" процессами
...
...
extensions/UNetUDP/tests/tests_with_sm.cc
View file @
055a718a
...
@@ -46,8 +46,8 @@ int main(int argc, char* argv[] )
...
@@ -46,8 +46,8 @@ int main(int argc, char* argv[] )
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
shm
);
act
->
add
(
shm
);
act
->
add
Object
(
unet
);
act
->
add
(
unet
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/UNetUDP/unetexchange.cc
View file @
055a718a
...
@@ -57,7 +57,7 @@ int main( int argc, const char** argv )
...
@@ -57,7 +57,7 @@ int main( int argc, const char** argv )
}
}
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
unet
);
act
->
add
(
unet
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/UniNetwork/uninet.cc
View file @
055a718a
...
@@ -46,7 +46,7 @@ int main(int argc, const char **argv)
...
@@ -46,7 +46,7 @@ int main(int argc, const char **argv)
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
uex
);
act
->
add
(
uex
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
run
(
true
);
act
->
run
(
true
);
...
...
extensions/include/UObject_SK.h
View file @
055a718a
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/
*/
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// generate timestamp: 201
4-11-30
+03:00
// generate timestamp: 201
5-01-12
+03:00
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
#ifndef UObject_SK_H_
#ifndef UObject_SK_H_
#define UObject_SK_H_
#define UObject_SK_H_
...
@@ -125,6 +125,7 @@ class UObject_SK:
...
@@ -125,6 +125,7 @@ class UObject_SK:
int
askPause
;
/*!< пауза между неудачными попытками заказать датчики */
int
askPause
;
/*!< пауза между неудачными попытками заказать датчики */
IOController_i
::
SensorInfo
si
;
IOController_i
::
SensorInfo
si
;
bool
forceOut
;
/*!< флаг принудительного обноления "выходов" */
private
:
private
:
...
...
extensions/lib/UObject_SK.cc
View file @
055a718a
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/
*/
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// generate timestamp: 201
4-11-30
+03:00
// generate timestamp: 201
5-01-12
+03:00
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
#include "Configuration.h"
#include "Configuration.h"
#include "Exceptions.h"
#include "Exceptions.h"
...
@@ -40,6 +40,7 @@ confnode(0),
...
@@ -40,6 +40,7 @@ confnode(0),
smReadyTimeout
(
0
),
smReadyTimeout
(
0
),
activated
(
false
),
activated
(
false
),
askPause
(
2000
),
askPause
(
2000
),
forceOut
(
false
),
end_private
(
false
)
end_private
(
false
)
{
{
...
@@ -75,6 +76,7 @@ confnode(cnode),
...
@@ -75,6 +76,7 @@ confnode(cnode),
smReadyTimeout
(
0
),
smReadyTimeout
(
0
),
activated
(
false
),
activated
(
false
),
askPause
(
uniset_conf
()
->
getPIntProp
(
cnode
,
"askPause"
,
2000
)),
askPause
(
uniset_conf
()
->
getPIntProp
(
cnode
,
"askPause"
,
2000
)),
forceOut
(
false
),
end_private
(
false
)
end_private
(
false
)
{
{
...
@@ -97,8 +99,14 @@ end_private(false)
...
@@ -97,8 +99,14 @@ end_private(false)
UniXML
::
iterator
it
(
cnode
);
UniXML
::
iterator
it
(
cnode
);
string
heart
=
conf
->
getArgParam
(
"--heartbeat-id"
,
it
.
getProp
(
"heartbeat_id"
));
forceOut
=
conf
->
getArgPInt
(
"--"
+
argprefix
+
"force-out"
,
it
.
getProp
(
"forceOut"
),
false
);
string
heart
=
conf
->
getArgParam
(
"--"
+
argprefix
+
"heartbeat-id"
,
it
.
getProp
(
"heartbeat_id"
));
if
(
!
heart
.
empty
()
)
if
(
!
heart
.
empty
()
)
{
{
idHeartBeat
=
conf
->
getSensorID
(
heart
);
idHeartBeat
=
conf
->
getSensorID
(
heart
);
...
@@ -109,24 +117,24 @@ end_private(false)
...
@@ -109,24 +117,24 @@ end_private(false)
throw
SystemError
(
err
.
str
());
throw
SystemError
(
err
.
str
());
}
}
int
heartbeatTime
=
conf
->
getArgPInt
(
"--heartbeat-time"
,
it
.
getProp
(
"heartbeatTime"
),
conf
->
getHeartBeatTime
());
int
heartbeatTime
=
conf
->
getArgPInt
(
"--
"
+
argprefix
+
"
heartbeat-time"
,
it
.
getProp
(
"heartbeatTime"
),
conf
->
getHeartBeatTime
());
if
(
heartbeatTime
>
0
)
if
(
heartbeatTime
>
0
)
ptHeartBeat
.
setTiming
(
heartbeatTime
);
ptHeartBeat
.
setTiming
(
heartbeatTime
);
else
else
ptHeartBeat
.
setTiming
(
UniSetTimer
::
WaitUpTime
);
ptHeartBeat
.
setTiming
(
UniSetTimer
::
WaitUpTime
);
maxHeartBeat
=
conf
->
getArgPInt
(
"--heartbeat-max"
,
it
.
getProp
(
"heartbeat_max"
),
10
);
maxHeartBeat
=
conf
->
getArgPInt
(
"--
"
+
argprefix
+
"
heartbeat-max"
,
it
.
getProp
(
"heartbeat_max"
),
10
);
}
}
// Инициализация значений
// Инициализация значений
sleep_msec
=
conf
->
getArgPInt
(
"--sleep-msec"
,
"150"
,
150
);
sleep_msec
=
conf
->
getArgPInt
(
"--
"
+
argprefix
+
"
sleep-msec"
,
"150"
,
150
);
resetMsgTime
=
conf
->
getPIntProp
(
cnode
,
"resetMsgTime"
,
2000
);
resetMsgTime
=
conf
->
getPIntProp
(
cnode
,
"resetMsgTime"
,
2000
);
ptResetMsg
.
setTiming
(
resetMsgTime
);
ptResetMsg
.
setTiming
(
resetMsgTime
);
smReadyTimeout
=
conf
->
getArgInt
(
"--sm-ready-timeout"
,
""
);
smReadyTimeout
=
conf
->
getArgInt
(
"--
"
+
argprefix
+
"
sm-ready-timeout"
,
""
);
if
(
smReadyTimeout
==
0
)
if
(
smReadyTimeout
==
0
)
smReadyTimeout
=
60000
;
smReadyTimeout
=
60000
;
else
if
(
smReadyTimeout
<
0
)
else
if
(
smReadyTimeout
<
0
)
...
@@ -135,9 +143,9 @@ end_private(false)
...
@@ -135,9 +143,9 @@ end_private(false)
smTestID
=
conf
->
getSensorID
(
init3_str
(
conf
->
getArgParam
(
"--"
+
argprefix
+
"sm-test-id"
),
conf
->
getProp
(
cnode
,
"smTestID"
),
""
));
smTestID
=
conf
->
getSensorID
(
init3_str
(
conf
->
getArgParam
(
"--"
+
argprefix
+
"sm-test-id"
),
conf
->
getProp
(
cnode
,
"smTestID"
),
""
));
activateTimeout
=
conf
->
getArgPInt
(
"--activate-timeout"
,
20000
);
activateTimeout
=
conf
->
getArgPInt
(
"--
"
+
argprefix
+
"
activate-timeout"
,
20000
);
int
msec
=
conf
->
getArgPInt
(
"--startup-timeout"
,
10000
);
int
msec
=
conf
->
getArgPInt
(
"--
"
+
argprefix
+
"
startup-timeout"
,
10000
);
ptStartUpTimeout
.
setTiming
(
msec
);
ptStartUpTimeout
.
setTiming
(
msec
);
// ===================== <variables> =====================
// ===================== <variables> =====================
...
@@ -367,7 +375,7 @@ void UObject_SK::callback()
...
@@ -367,7 +375,7 @@ void UObject_SK::callback()
if
(
!
receiveMessage
(
msg
)
)
if
(
!
receiveMessage
(
msg
)
)
break
;
break
;
processingMessage
(
&
msg
);
processingMessage
(
&
msg
);
updateOutputs
(
f
alse
);
updateOutputs
(
f
orceOut
);
// updatePreviousValues();
// updatePreviousValues();
}
}
...
@@ -382,7 +390,7 @@ void UObject_SK::callback()
...
@@ -382,7 +390,7 @@ void UObject_SK::callback()
}
}
// обновление выходов
// обновление выходов
updateOutputs
(
f
alse
);
updateOutputs
(
f
orceOut
);
updatePreviousValues
();
updatePreviousValues
();
}
}
catch
(
Exception
&
ex
)
catch
(
Exception
&
ex
)
...
...
extensions/tests/SMemoryTest/smemory-test.cc
View file @
055a718a
...
@@ -29,13 +29,13 @@ int main(int argc, const char **argv)
...
@@ -29,13 +29,13 @@ int main(int argc, const char **argv)
ulog
.
logFile
(
logname
);
ulog
.
logFile
(
logname
);
dlog
.
logFile
(
logname
);
dlog
.
logFile
(
logname
);
SharedMemory
*
shm
=
SharedMemory
::
init_smemory
(
argc
,
argv
);
auto
shm
=
SharedMemory
::
init_smemory
(
argc
,
argv
);
if
(
!
shm
)
if
(
!
shm
)
return
1
;
return
1
;
UniSetActivatorPtr
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
static_cast
<
class
UniSetObject
*>
(
shm
)
);
act
->
add
(
shm
);
int
num
=
conf
->
getArgPInt
(
"--numproc"
,
1
);
int
num
=
conf
->
getArgPInt
(
"--numproc"
,
1
);
...
@@ -47,7 +47,7 @@ int main(int argc, const char **argv)
...
@@ -47,7 +47,7 @@ int main(int argc, const char **argv)
cout
<<
"..create "
<<
s
.
str
()
<<
endl
;
cout
<<
"..create "
<<
s
.
str
()
<<
endl
;
TestProc
*
tp
=
new
TestProc
(
conf
->
getObjectID
(
s
.
str
()));
TestProc
*
tp
=
new
TestProc
(
conf
->
getObjectID
(
s
.
str
()));
tp
->
init_dlog
(
dlog
);
tp
->
init_dlog
(
dlog
);
act
->
add
Object
(
static_cast
<
class
UniSetObject
*>
(
tp
));
act
->
add
(
tp
->
get_ptr
(
));
}
}
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
...
...
extensions/tests/tests_with_sm.cc
View file @
055a718a
...
@@ -70,7 +70,7 @@ int main(int argc, char* argv[] )
...
@@ -70,7 +70,7 @@ int main(int argc, char* argv[] )
auto
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
shm
);
act
->
add
(
shm
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
run
(
true
);
act
->
run
(
true
);
...
...
include/UniSetActivator.h
View file @
055a718a
...
@@ -69,7 +69,7 @@ class UniSetActivator:
...
@@ -69,7 +69,7 @@ class UniSetActivator:
virtual
void
oaDestroy
(
int
signo
=
0
);
virtual
void
oaDestroy
(
int
signo
=
0
);
void
waitDestroy
();
void
waitDestroy
();
inline
void
oakill
(
int
signo
){
raise
(
signo
);
}
// inline void oakill(int signo){ raise(signo);
}
virtual
UniSetTypes
::
ObjectType
getType
()
override
{
return
UniSetTypes
::
ObjectType
(
"UniSetActivator"
);
}
virtual
UniSetTypes
::
ObjectType
getType
()
override
{
return
UniSetTypes
::
ObjectType
(
"UniSetActivator"
);
}
...
@@ -114,7 +114,6 @@ class UniSetActivator:
...
@@ -114,7 +114,6 @@ class UniSetActivator:
private
:
private
:
// static void processingSignal(int signo);
static
void
terminated
(
int
signo
);
static
void
terminated
(
int
signo
);
static
void
finishterm
(
int
signo
);
static
void
finishterm
(
int
signo
);
static
void
normalexit
();
static
void
normalexit
();
...
@@ -123,8 +122,7 @@ class UniSetActivator:
...
@@ -123,8 +122,7 @@ class UniSetActivator:
void
term
(
int
signo
);
void
term
(
int
signo
);
void
init
();
void
init
();
friend
class
ThreadCreator
<
UniSetActivator
>
;
std
::
shared_ptr
<
ThreadCreator
<
UniSetActivator
>
>
orbthr
;
ThreadCreator
<
UniSetActivator
>
*
orbthr
;
CORBA
::
ORB_var
orb
;
CORBA
::
ORB_var
orb
;
TerminateEvent_Signal
s_term
;
TerminateEvent_Signal
s_term
;
...
@@ -132,31 +130,6 @@ class UniSetActivator:
...
@@ -132,31 +130,6 @@ class UniSetActivator:
bool
omDestroy
;
bool
omDestroy
;
bool
sig
;
bool
sig
;
pid_t
thpid
;
// pid orb потока
pid_t
thpid
;
// pid orb потока
struct
Info
{
Info
(
pid_t
p
)
:
msgpid
(
p
){}
pid_t
msgpid
;
// pid порожденого потока обработки сообщений
};
struct
OInfo
:
public
Info
{
OInfo
(
std
::
shared_ptr
<
UniSetObject
>
o
,
pid_t
p
)
:
Info
(
p
),
obj
(
o
){}
std
::
shared_ptr
<
UniSetObject
>
obj
;
};
struct
MInfo
:
public
Info
{
MInfo
(
std
::
shared_ptr
<
UniSetManager
>
m
,
pid_t
p
)
:
Info
(
p
),
mnr
(
m
){}
std
::
shared_ptr
<
UniSetManager
>
mnr
;
};
std
::
deque
<
OInfo
>
lstOInfo
;
std
::
deque
<
MInfo
>
lstMInfo
;
void
getinfo
();
};
};
/*
/*
...
...
include/UniSetManager.h
View file @
055a718a
...
@@ -72,26 +72,19 @@ class UniSetManager:
...
@@ -72,26 +72,19 @@ class UniSetManager:
virtual
UniSetTypes
::
SimpleInfoSeq
*
getObjectsInfo
(
CORBA
::
Long
MaxLength
=
300
)
override
;
virtual
UniSetTypes
::
SimpleInfoSeq
*
getObjectsInfo
(
CORBA
::
Long
MaxLength
=
300
)
override
;
// --------------------------
// --------------------------
void
initPOA
(
const
std
::
weak_ptr
<
UniSetManager
>&
rmngr
);
virtual
bool
add
(
const
std
::
shared_ptr
<
UniSetObject
>&
obj
);
virtual
bool
remove
(
const
std
::
shared_ptr
<
UniSetObject
>&
obj
);
virtual
bool
addObject
(
const
std
::
shared_ptr
<
UniSetObject
>&
obj
);
// --------------------------
virtual
bool
removeObject
(
const
std
::
shared_ptr
<
UniSetObject
>&
obj
);
virtual
bool
addManager
(
const
std
::
shared_ptr
<
UniSetManager
>&
mngr
);
virtual
bool
removeManager
(
const
std
::
shared_ptr
<
UniSetManager
>&
mngr
);
/*! Получение доступа к подчиненному менеджеру по идентификатору
/*! Получение доступа к подчиненному менеджеру по идентификатору
* \return
объект ненайден будет возвращен 0.
* \return
shared_ptr<>, если объект не найден будет возвращен shared_ptr<> = nullptr
*/
*/
const
std
::
shared_ptr
<
UniSetManager
>
itemM
(
const
UniSetTypes
::
ObjectId
id
);
const
std
::
shared_ptr
<
UniSetManager
>
itemM
(
const
UniSetTypes
::
ObjectId
id
);
/*! Получение доступа к подчиненному объекту по идентификатору
/*! Получение доступа к подчиненному объекту по идентификатору
* \return
объект ненайден будет возвращен 0.
* \return
shared_ptr<>, если объект не найден будет возвращен shared_ptr<> = nullptr
*/
*/
const
std
::
shared_ptr
<
UniSetObject
>
itemO
(
const
UniSetTypes
::
ObjectId
id
);
const
std
::
shared_ptr
<
UniSetObject
>
itemO
(
const
UniSetTypes
::
ObjectId
id
);
// Функции для аботы со списками подчиненных объектов
// Функции для аботы со списками подчиненных объектов
inline
UniSetManagerList
::
const_iterator
beginMList
()
inline
UniSetManagerList
::
const_iterator
beginMList
()
{
{
...
@@ -122,6 +115,11 @@ class UniSetManager:
...
@@ -122,6 +115,11 @@ class UniSetManager:
UniSetManager
();
UniSetManager
();
virtual
bool
addManager
(
const
std
::
shared_ptr
<
UniSetManager
>&
mngr
);
virtual
bool
removeManager
(
const
std
::
shared_ptr
<
UniSetManager
>&
mngr
);
virtual
bool
addObject
(
const
std
::
shared_ptr
<
UniSetObject
>&
obj
);
virtual
bool
removeObject
(
const
std
::
shared_ptr
<
UniSetObject
>&
obj
);
enum
OManagerCommand
{
deactiv
,
activ
,
initial
,
term
};
enum
OManagerCommand
{
deactiv
,
activ
,
initial
,
term
};
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
OManagerCommand
&
cmd
);
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
OManagerCommand
&
cmd
);
...
@@ -132,6 +130,8 @@ class UniSetManager:
...
@@ -132,6 +130,8 @@ class UniSetManager:
virtual
void
sigterm
(
int
signo
)
override
;
virtual
void
sigterm
(
int
signo
)
override
;
void
initPOA
(
const
std
::
weak_ptr
<
UniSetManager
>&
rmngr
);
//! \note Переопределяя не забывайте вызвать базовую
//! \note Переопределяя не забывайте вызвать базовую
virtual
bool
activateObject
()
override
;
virtual
bool
activateObject
()
override
;
//! \note Переопределяя не забывайте вызвать базовую
//! \note Переопределяя не забывайте вызвать базовую
...
@@ -147,8 +147,6 @@ class UniSetManager:
...
@@ -147,8 +147,6 @@ class UniSetManager:
private
:
private
:
friend
class
UniSetActivator
;
int
sig
;
int
sig
;
UniSetManagerList
mlist
;
UniSetManagerList
mlist
;
ObjectsList
olist
;
ObjectsList
olist
;
...
...
src/ObjectRepository/UniSetActivator.cc
View file @
055a718a
...
@@ -98,7 +98,6 @@ void UniSetActivator::Destroy()
...
@@ -98,7 +98,6 @@ void UniSetActivator::Destroy()
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
UniSetActivator
::
UniSetActivator
(
const
ObjectId
id
)
:
UniSetActivator
::
UniSetActivator
(
const
ObjectId
id
)
:
UniSetManager
(
id
),
UniSetManager
(
id
),
orbthr
(
0
),
omDestroy
(
false
),
omDestroy
(
false
),
sig
(
false
)
sig
(
false
)
{
{
...
@@ -107,7 +106,6 @@ sig(false)
...
@@ -107,7 +106,6 @@ sig(false)
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
UniSetActivator
::
UniSetActivator
()
:
UniSetActivator
::
UniSetActivator
()
:
UniSetManager
(
UniSetTypes
::
DefaultObjectId
),
UniSetManager
(
UniSetTypes
::
DefaultObjectId
),
orbthr
(
0
),
omDestroy
(
false
),
omDestroy
(
false
),
sig
(
false
)
sig
(
false
)
{
{
...
@@ -146,8 +144,7 @@ UniSetActivator::~UniSetActivator()
...
@@ -146,8 +144,7 @@ UniSetActivator::~UniSetActivator()
if
(
orbthr
->
isRunning
()
)
if
(
orbthr
->
isRunning
()
)
orbthr
->
join
();
orbthr
->
join
();
delete
orbthr
;
orbthr
.
reset
();
orbthr
=
0
;
}
}
if
(
!
procterm
)
if
(
!
procterm
)
...
@@ -205,7 +202,6 @@ void UniSetActivator::oaDestroy(int signo)
...
@@ -205,7 +202,6 @@ void UniSetActivator::oaDestroy(int signo)
pman
->
deactivate
(
false
,
true
);
pman
->
deactivate
(
false
,
true
);
ulogsys
<<
myname
<<
"(oaDestroy): pman deactivate ok. "
<<
endl
;
ulogsys
<<
myname
<<
"(oaDestroy): pman deactivate ok. "
<<
endl
;
ulogsys
<<
myname
<<
"(oaDestroy): orbthr="
<<
orbthr
<<
endl
;
if
(
orbthr
)
if
(
orbthr
)
{
{
try
try
...
@@ -263,7 +259,6 @@ void UniSetActivator::run( bool thread )
...
@@ -263,7 +259,6 @@ void UniSetActivator::run( bool thread )
UniSetManager
::
activate
();
// а там вызывается активация всех подчиненных объектов и менеджеров
UniSetManager
::
activate
();
// а там вызывается активация всех подчиненных объектов и менеджеров
getinfo
();
// заполнение информации об объектах
active
=
true
;
active
=
true
;
ulogsys
<<
myname
<<
"(run): активизируем менеджер"
<<
endl
;
ulogsys
<<
myname
<<
"(run): активизируем менеджер"
<<
endl
;
...
@@ -274,7 +269,7 @@ void UniSetActivator::run( bool thread )
...
@@ -274,7 +269,7 @@ void UniSetActivator::run( bool thread )
if
(
thread
)
if
(
thread
)
{
{
uinfo
<<
myname
<<
"(run): запускаемся с созданием отдельного потока... "
<<
endl
;
uinfo
<<
myname
<<
"(run): запускаемся с созданием отдельного потока... "
<<
endl
;
orbthr
=
new
ThreadCreator
<
UniSetActivator
>
(
this
,
&
UniSetActivator
::
work
);
orbthr
=
make_shared
<
ThreadCreator
<
UniSetActivator
>
>
(
this
,
&
UniSetActivator
::
work
);
int
ret
=
orbthr
->
start
();
int
ret
=
orbthr
->
start
();
if
(
ret
!=
0
)
if
(
ret
!=
0
)
{
{
...
@@ -327,7 +322,7 @@ void UniSetActivator::stop()
...
@@ -327,7 +322,7 @@ void UniSetActivator::stop()
void
UniSetActivator
::
work
()
void
UniSetActivator
::
work
()
{
{
ulogsys
<<
myname
<<
"(work): запускаем orb на обработку запросов...
(orbthr="
<<
orbthr
<<
")
"
<<
endl
;
ulogsys
<<
myname
<<
"(work): запускаем orb на обработку запросов..."
<<
endl
;
try
try
{
{
if
(
orbthr
)
if
(
orbthr
)
...
@@ -371,15 +366,6 @@ void UniSetActivator::work()
...
@@ -371,15 +366,6 @@ void UniSetActivator::work()
ulogsys
<<
myname
<<
"(oaDestroy): orb destroy ok."
<<
endl
;
ulogsys
<<
myname
<<
"(oaDestroy): orb destroy ok."
<<
endl
;
}
}
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
void
UniSetActivator
::
getinfo
()
{
for
(
auto
it
=
beginMList
();
it
!=
endMList
();
++
it
)
lstMInfo
.
emplace_back
(
(
*
it
),
(
*
it
)
->
getMsgPID
()
);
for
(
auto
it
=
beginOList
();
it
!=
endOList
();
++
it
)
lstOInfo
.
emplace_back
(
(
*
it
),
(
*
it
)
->
getMsgPID
()
);
}
// ------------------------------------------------------------------------------------------
void
UniSetActivator
::
sysCommand
(
const
UniSetTypes
::
SystemMessage
*
sm
)
void
UniSetActivator
::
sysCommand
(
const
UniSetTypes
::
SystemMessage
*
sm
)
{
{
switch
(
sm
->
command
)
switch
(
sm
->
command
)
...
@@ -541,8 +527,7 @@ void UniSetActivator::term( int signo )
...
@@ -541,8 +527,7 @@ void UniSetActivator::term( int signo )
if
(
orbthr
->
isRunning
()
)
if
(
orbthr
->
isRunning
()
)
orbthr
->
join
();
orbthr
->
join
();
delete
orbthr
;
orbthr
.
reset
();
orbthr
=
0
;
}
}
sigterm
(
signo
);
sigterm
(
signo
);
...
...
src/ObjectRepository/UniSetManager.cc
View file @
055a718a
...
@@ -88,8 +88,8 @@ class OPush: public unary_function< const std::shared_ptr<UniSetObject>& , bool>
...
@@ -88,8 +88,8 @@ class OPush: public unary_function< const std::shared_ptr<UniSetObject>& , bool>
UniSetManager
::
UniSetManager
()
:
UniSetManager
::
UniSetManager
()
:
UniSetObject
(
UniSetTypes
::
DefaultObjectId
),
UniSetObject
(
UniSetTypes
::
DefaultObjectId
),
sig
(
0
),
sig
(
0
),
olistMutex
(
"olistMutex"
),
olistMutex
(
"
UniSetManager_
olistMutex"
),
mlistMutex
(
"mlistMutex"
)
mlistMutex
(
"
UniSetManager_
mlistMutex"
)
{
{
}
}
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
...
@@ -179,8 +179,27 @@ void UniSetManager::initPOA( const std::weak_ptr<UniSetManager>& rmngr )
...
@@ -179,8 +179,27 @@ void UniSetManager::initPOA( const std::weak_ptr<UniSetManager>& rmngr )
managers
(
initial
);
managers
(
initial
);
}
}
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
bool
UniSetManager
::
add
(
const
std
::
shared_ptr
<
UniSetObject
>&
obj
)
{
auto
m
=
std
::
dynamic_pointer_cast
<
UniSetManager
>
(
obj
);
if
(
m
)
return
addManager
(
m
);
return
addObject
(
obj
);
}
// ------------------------------------------------------------------------------------------
bool
UniSetManager
::
remove
(
const
std
::
shared_ptr
<
UniSetObject
>&
obj
)
{
auto
m
=
std
::
dynamic_pointer_cast
<
UniSetManager
>
(
obj
);
if
(
m
)
return
removeManager
(
m
);
return
removeObject
(
obj
);
}
// ------------------------------------------------------------------------------------------
bool
UniSetManager
::
addObject
(
const
std
::
shared_ptr
<
UniSetObject
>&
obj
)
bool
UniSetManager
::
addObject
(
const
std
::
shared_ptr
<
UniSetObject
>&
obj
)
{
{
{
//lock
{
//lock
uniset_rwmutex_wrlock
lock
(
olistMutex
);
uniset_rwmutex_wrlock
lock
(
olistMutex
);
auto
li
=
find
(
olist
.
begin
(),
olist
.
end
(),
obj
);
auto
li
=
find
(
olist
.
begin
(),
olist
.
end
(),
obj
);
...
@@ -493,11 +512,8 @@ int UniSetManager::objectsCount()
...
@@ -493,11 +512,8 @@ int UniSetManager::objectsCount()
{
{
int
res
(
olist
.
size
()
+
mlist
.
size
()
);
int
res
(
olist
.
size
()
+
mlist
.
size
()
);
for
(
UniSetManagerList
::
const_iterator
it
=
beginMList
();
for
(
auto
i
:
mlist
)
it
!=
endMList
();
++
it
)
res
+=
i
->
objectsCount
();
{
res
+=
(
*
it
)
->
objectsCount
();
}
return
res
;
return
res
;
}
}
...
@@ -541,9 +557,9 @@ int UniSetManager::getObjectsInfo( const std::shared_ptr<UniSetManager>& mngr, S
...
@@ -541,9 +557,9 @@ int UniSetManager::getObjectsInfo( const std::shared_ptr<UniSetManager>& mngr, S
return
ind
;
return
ind
;
// а далее у его менеджеров (рекурсивно)
// а далее у его менеджеров (рекурсивно)
for
(
auto
it
=
mngr
->
beginMList
();
it
!=
mngr
->
endMList
();
++
i
t
)
for
(
auto
&
i
:
mlis
t
)
{
{
ind
=
getObjectsInfo
(
(
*
it
)
,
seq
,
ind
,
uplimit
);
ind
=
getObjectsInfo
(
i
,
seq
,
ind
,
uplimit
);
if
(
ind
>
uplimit
)
if
(
ind
>
uplimit
)
break
;
break
;
}
}
...
...
src/ObjectRepository/UniSetObject.cc
View file @
055a718a
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