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
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
200 additions
and
214 deletions
+200
-214
TODO
TODO
+6
-0
admin.cc
Utilities/Admin/admin.cc
+9
-9
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
+16
-15
UObject_SK.cc
extensions/lib/UObject_SK.cc
+50
-42
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
+33
-17
UniSetObject.cc
src/ObjectRepository/UniSetObject.cc
+24
-24
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
...
@@ -339,8 +339,8 @@ int main(int argc, char** argv)
...
@@ -339,8 +339,8 @@ int main(int argc, char** argv)
// ==============================================================================================
// ==============================================================================================
static
bool
commandToAll
(
const
string
&
section
,
ObjectRepository
*
rep
,
Command
cmd
)
static
bool
commandToAll
(
const
string
&
section
,
ObjectRepository
*
rep
,
Command
cmd
)
{
{
if
(
verb
)
if
(
verb
)
cout
<<
"
\n
||=======******** "
<<
section
<<
" ********=========||
\n
"
<<
endl
;
cout
<<
"
\n
||=======******** "
<<
section
<<
" ********=========||
\n
"
<<
endl
;
try
try
{
{
...
@@ -407,7 +407,7 @@ static bool commandToAll(const string& section, ObjectRepository *rep, Command c
...
@@ -407,7 +407,7 @@ static bool commandToAll(const string& section, ObjectRepository *rep, Command c
if
(
obj
->
exist
()
)
if
(
obj
->
exist
()
)
cout
<<
setw
(
55
)
<<
ob
<<
" <--- exist ok
\n
"
;
cout
<<
setw
(
55
)
<<
ob
<<
" <--- exist ok
\n
"
;
else
else
cout
<<
setw
(
55
)
<<
ob
<<
" <--- exist NOT OK
\n
"
;
cout
<<
setw
(
55
)
<<
ob
<<
" <--- exist NOT OK
\n
"
;
}
}
break
;
break
;
...
@@ -585,16 +585,16 @@ int getValue( const string& args, UInterface &ui )
...
@@ -585,16 +585,16 @@ int getValue( const string& args, UInterface &ui )
break
;
break
;
default:
default:
if
(
!
quiet
)
if
(
!
quiet
)
cerr
<<
"FAILED: Unknown 'iotype' for "
<<
it
->
fname
<<
endl
;
cerr
<<
"FAILED: Unknown 'iotype' for "
<<
it
->
fname
<<
endl
;
err
=
1
;
err
=
1
;
break
;
break
;
}
}
}
}
catch
(
Exception
&
ex
)
catch
(
Exception
&
ex
)
{
{
if
(
!
quiet
)
if
(
!
quiet
)
cerr
<<
"(getValue): "
<<
ex
<<
endl
;
cerr
<<
"(getValue): "
<<
ex
<<
endl
;
err
=
1
;
err
=
1
;
}
}
}
}
...
@@ -747,8 +747,8 @@ int oinfo( const string& arg, UInterface &ui )
...
@@ -747,8 +747,8 @@ int oinfo( const string& arg, UInterface &ui )
UniSetTypes
::
ObjectId
oid
(
uni_atoi
(
arg
));
UniSetTypes
::
ObjectId
oid
(
uni_atoi
(
arg
));
if
(
oid
==
0
)
if
(
oid
==
0
)
{
{
if
(
!
quiet
)
if
(
!
quiet
)
cout
<<
"(oinfo): Не задан OID!"
<<
endl
;
cout
<<
"(oinfo): Не задан OID!"
<<
endl
;
return
1
;
return
1
;
}
}
...
...
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_
...
@@ -29,7 +29,7 @@ class UObject_SK:
...
@@ -29,7 +29,7 @@ class UObject_SK:
UObject_SK
();
UObject_SK
();
virtual
~
UObject_SK
();
virtual
~
UObject_SK
();
bool
alarm
(
UniSetTypes
::
ObjectId
sid
,
bool
state
);
bool
alarm
(
UniSetTypes
::
ObjectId
sid
,
bool
state
);
long
getValue
(
UniSetTypes
::
ObjectId
sid
);
long
getValue
(
UniSetTypes
::
ObjectId
sid
);
void
setValue
(
UniSetTypes
::
ObjectId
sid
,
long
value
);
void
setValue
(
UniSetTypes
::
ObjectId
sid
,
long
value
);
...
@@ -56,26 +56,26 @@ class UObject_SK:
...
@@ -56,26 +56,26 @@ class UObject_SK:
// Используемые идентификаторы
// Используемые идентификаторы
// Используемые идентификаторы сообщений
// Используемые идентификаторы сообщений
// Текущее значение
// Текущее значение
// --- public variables ---
// --- public variables ---
// --- end of public variables ---
// --- end of public variables ---
protected
:
protected
:
// --- protected variables ---
// --- protected variables ---
// ---- end of protected variables ----
// ---- end of protected variables ----
virtual
void
callback
()
override
;
virtual
void
callback
()
override
;
virtual
void
processingMessage
(
UniSetTypes
::
VoidMessage
*
msg
)
override
;
virtual
void
processingMessage
(
UniSetTypes
::
VoidMessage
*
msg
)
override
;
virtual
void
sysCommand
(
const
UniSetTypes
::
SystemMessage
*
sm
)
override
;
virtual
void
sysCommand
(
const
UniSetTypes
::
SystemMessage
*
sm
)
override
;
...
@@ -111,7 +111,7 @@ class UObject_SK:
...
@@ -111,7 +111,7 @@ class UObject_SK:
PassiveTimer
ptHeartBeat
;
/*! < период "сердцебиения" */
PassiveTimer
ptHeartBeat
;
/*! < период "сердцебиения" */
UniSetTypes
::
ObjectId
idHeartBeat
;
/*! < идентификатор датчика (AI) "сердцебиения" */
UniSetTypes
::
ObjectId
idHeartBeat
;
/*! < идентификатор датчика (AI) "сердцебиения" */
int
maxHeartBeat
;
/*! < сохраняемое значение */
int
maxHeartBeat
;
/*! < сохраняемое значение */
xmlNode
*
confnode
;
xmlNode
*
confnode
;
/*! получить числовое свойство из конф. файла по привязанной confnode */
/*! получить числовое свойство из конф. файла по привязанной confnode */
int
getIntProp
(
const
std
::
string
&
name
)
{
return
UniSetTypes
::
uniset_conf
()
->
getIntProp
(
confnode
,
name
);
}
int
getIntProp
(
const
std
::
string
&
name
)
{
return
UniSetTypes
::
uniset_conf
()
->
getIntProp
(
confnode
,
name
);
}
...
@@ -123,20 +123,21 @@ class UObject_SK:
...
@@ -123,20 +123,21 @@ class UObject_SK:
int
activateTimeout
;
/*!< время ожидания готовности UniSetObject к работе */
int
activateTimeout
;
/*!< время ожидания готовности UniSetObject к работе */
PassiveTimer
ptStartUpTimeout
;
/*!< время на блокировку обработки WatchDog, если недавно был StartUp */
PassiveTimer
ptStartUpTimeout
;
/*!< время на блокировку обработки WatchDog, если недавно был StartUp */
int
askPause
;
/*!< пауза между неудачными попытками заказать датчики */
int
askPause
;
/*!< пауза между неудачными попытками заказать датчики */
IOController_i
::
SensorInfo
si
;
IOController_i
::
SensorInfo
si
;
bool
forceOut
;
/*!< флаг принудительного обноления "выходов" */
private
:
private
:
// --- private variables ---
// --- private variables ---
// --- end of private variables ---
// --- end of private variables ---
// предыдущее значение (для работы UpdateValue())
// предыдущее значение (для работы UpdateValue())
// Используемые идентификаторы сообщений
// Используемые идентификаторы сообщений
bool
end_private
;
// вспомогательное поле (для внутреннего использования при генерировании кода)
bool
end_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
)
{
{
...
@@ -54,7 +55,7 @@ static const std::string init3_str( const std::string& s1, const std::string& s2
...
@@ -54,7 +55,7 @@ static const std::string init3_str( const std::string& s1, const std::string& s2
return
s1
;
return
s1
;
if
(
!
s2
.
empty
()
)
if
(
!
s2
.
empty
()
)
return
s2
;
return
s2
;
return
s3
;
return
s3
;
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
...
@@ -75,12 +76,13 @@ confnode(cnode),
...
@@ -75,12 +76,13 @@ 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
)
{
{
auto
conf
=
uniset_conf
();
auto
conf
=
uniset_conf
();
if
(
UniSetTypes
::
findArgParam
(
"--print-id-list"
,
uniset_conf
()
->
getArgc
(),
uniset_conf
()
->
getArgv
())
!=
-
1
)
if
(
UniSetTypes
::
findArgParam
(
"--print-id-list"
,
uniset_conf
()
->
getArgc
(),
uniset_conf
()
->
getArgv
())
!=
-
1
)
{
{
...
@@ -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,39 +117,39 @@ end_private(false)
...
@@ -109,39 +117,39 @@ 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
)
smReadyTimeout
=
UniSetTimer
::
WaitUpTime
;
smReadyTimeout
=
UniSetTimer
::
WaitUpTime
;
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
(
"--"
+
argprefix
+
"activate-timeout"
,
20000
);
activateTimeout
=
conf
->
getArgPInt
(
"--activate-timeout"
,
20000
);
int
msec
=
conf
->
getArgPInt
(
"--"
+
argprefix
+
"startup-timeout"
,
10000
);
int
msec
=
conf
->
getArgPInt
(
"--startup-timeout"
,
10000
);
ptStartUpTimeout
.
setTiming
(
msec
);
ptStartUpTimeout
.
setTiming
(
msec
);
// ===================== <variables> =====================
// ===================== <variables> =====================
// ===================== end of <variables> =====================
// ===================== end of <variables> =====================
}
}
...
@@ -154,17 +162,17 @@ UObject_SK::~UObject_SK()
...
@@ -154,17 +162,17 @@ UObject_SK::~UObject_SK()
void
UObject_SK
::
updateValues
()
void
UObject_SK
::
updateValues
()
{
{
// Опрашиваем все входы...
// Опрашиваем все входы...
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void
UObject_SK
::
updatePreviousValues
()
void
UObject_SK
::
updatePreviousValues
()
{
{
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void
UObject_SK
::
checkSensors
()
void
UObject_SK
::
checkSensors
()
{
{
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
bool
UObject_SK
::
alarm
(
UniSetTypes
::
ObjectId
_code
,
bool
_state
)
bool
UObject_SK
::
alarm
(
UniSetTypes
::
ObjectId
_code
,
bool
_state
)
...
@@ -174,13 +182,13 @@ bool UObject_SK::alarm( UniSetTypes::ObjectId _code, bool _state )
...
@@ -174,13 +182,13 @@ bool UObject_SK::alarm( UniSetTypes::ObjectId _code, bool _state )
ucrit
<<
getName
()
ucrit
<<
getName
()
<<
"(alarm): попытка послать сообщение с DefaultObjectId"
<<
"(alarm): попытка послать сообщение с DefaultObjectId"
<<
endl
;
<<
endl
;
return
false
;
return
false
;
}
}
ulog1
<<
getName
()
<<
"(alarm): "
<<
(
_state
?
"SEND "
:
"RESET "
)
<<
endl
;
ulog1
<<
getName
()
<<
"(alarm): "
<<
(
_state
?
"SEND "
:
"RESET "
)
<<
endl
;
ulog1
<<
" not found MessgeOID?!!"
<<
endl
;
ulog1
<<
" not found MessgeOID?!!"
<<
endl
;
return
false
;
return
false
;
}
}
...
@@ -197,7 +205,7 @@ void UObject_SK::testMode( bool _state )
...
@@ -197,7 +205,7 @@ void UObject_SK::testMode( bool _state )
return
;
return
;
// отключаем все выходы
// отключаем все выходы
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
...
@@ -229,7 +237,7 @@ void UObject_SK::processingMessage( UniSetTypes::VoidMessage* _msg )
...
@@ -229,7 +237,7 @@ void UObject_SK::processingMessage( UniSetTypes::VoidMessage* _msg )
default
:
default
:
break
;
break
;
}
}
}
}
catch
(
Exception
&
ex
)
catch
(
Exception
&
ex
)
{
{
...
@@ -261,13 +269,13 @@ void UObject_SK::sysCommand( const SystemMessage* _sm )
...
@@ -261,13 +269,13 @@ void UObject_SK::sysCommand( const SystemMessage* _sm )
active
=
true
;
active
=
true
;
break
;
break
;
}
}
case
SystemMessage
:
:
FoldUp
:
case
SystemMessage
:
:
FoldUp
:
case
SystemMessage
:
:
Finish
:
case
SystemMessage
:
:
Finish
:
preAskSensors
(
UniversalIO
::
UIODontNotify
);
preAskSensors
(
UniversalIO
::
UIODontNotify
);
askSensors
(
UniversalIO
::
UIODontNotify
);
askSensors
(
UniversalIO
::
UIODontNotify
);
break
;
break
;
case
SystemMessage
:
:
LogRotate
:
case
SystemMessage
:
:
LogRotate
:
{
{
// переоткрываем логи
// переоткрываем логи
...
@@ -295,7 +303,7 @@ void UObject_SK::sigterm( int signo )
...
@@ -295,7 +303,7 @@ void UObject_SK::sigterm( int signo )
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
bool
UObject_SK
::
activateObject
()
bool
UObject_SK
::
activateObject
()
{
{
// блокирование обработки Startup
// блокирование обработки Startup
// пока не пройдёт инициализация датчиков
// пока не пройдёт инициализация датчиков
// см. sysCommand()
// см. sysCommand()
{
{
...
@@ -321,16 +329,16 @@ void UObject_SK::waitSM( int wait_msec, ObjectId _testID )
...
@@ -321,16 +329,16 @@ void UObject_SK::waitSM( int wait_msec, ObjectId _testID )
if
(
_testID
==
DefaultObjectId
)
if
(
_testID
==
DefaultObjectId
)
return
;
return
;
uinfo
<<
myname
<<
"(waitSM): waiting SM ready "
uinfo
<<
myname
<<
"(waitSM): waiting SM ready "
<<
wait_msec
<<
" msec"
<<
wait_msec
<<
" msec"
<<
" testID="
<<
_testID
<<
endl
;
<<
" testID="
<<
_testID
<<
endl
;
if
(
!
ui
.
waitReady
(
_testID
,
wait_msec
)
)
if
(
!
ui
.
waitReady
(
_testID
,
wait_msec
)
)
{
{
ostringstream
err
;
ostringstream
err
;
err
<<
myname
err
<<
myname
<<
"(waitSM): Не дождались готовности(exist) SharedMemory к работе в течение "
<<
"(waitSM): Не дождались готовности(exist) SharedMemory к работе в течение "
<<
wait_msec
<<
" мсек"
;
<<
wait_msec
<<
" мсек"
;
ucrit
<<
err
.
str
()
<<
endl
;
ucrit
<<
err
.
str
()
<<
endl
;
...
@@ -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
)
...
@@ -401,26 +409,26 @@ void UObject_SK::callback()
...
@@ -401,26 +409,26 @@ void UObject_SK::callback()
if
(
!
active
)
if
(
!
active
)
return
;
return
;
msleep
(
sleep_msec
);
msleep
(
sleep_msec
);
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void
UObject_SK
::
setValue
(
UniSetTypes
::
ObjectId
_sid
,
long
_val
)
void
UObject_SK
::
setValue
(
UniSetTypes
::
ObjectId
_sid
,
long
_val
)
{
{
ui
.
setValue
(
_sid
,
_val
);
ui
.
setValue
(
_sid
,
_val
);
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void
UObject_SK
::
updateOutputs
(
bool
_force
)
void
UObject_SK
::
updateOutputs
(
bool
_force
)
{
{
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void
UObject_SK
::
preSensorInfo
(
const
UniSetTypes
::
SensorMessage
*
_sm
)
void
UObject_SK
::
preSensorInfo
(
const
UniSetTypes
::
SensorMessage
*
_sm
)
{
{
sensorInfo
(
_sm
);
sensorInfo
(
_sm
);
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
...
@@ -449,13 +457,13 @@ void UObject_SK::preAskSensors( UniversalIO::UIOCommand _cmd )
...
@@ -449,13 +457,13 @@ void UObject_SK::preAskSensors( UniversalIO::UIOCommand _cmd )
{
{
PassiveTimer
ptAct
(
activateTimeout
);
PassiveTimer
ptAct
(
activateTimeout
);
while
(
!
activated
&&
!
ptAct
.
checkTime
()
)
while
(
!
activated
&&
!
ptAct
.
checkTime
()
)
{
{
cout
<<
myname
<<
"(preAskSensors): wait activate..."
<<
endl
;
cout
<<
myname
<<
"(preAskSensors): wait activate..."
<<
endl
;
msleep
(
300
);
msleep
(
300
);
if
(
activated
)
if
(
activated
)
break
;
break
;
}
}
if
(
!
activated
)
if
(
!
activated
)
ucrit
<<
myname
ucrit
<<
myname
<<
"(preAskSensors): ************* don`t activated?! ************"
<<
endl
;
<<
"(preAskSensors): ************* don`t activated?! ************"
<<
endl
;
...
@@ -464,7 +472,7 @@ void UObject_SK::preAskSensors( UniversalIO::UIOCommand _cmd )
...
@@ -464,7 +472,7 @@ void UObject_SK::preAskSensors( UniversalIO::UIOCommand _cmd )
{
{
try
try
{
{
return
;
return
;
}
}
catch
(
SystemError
&
err
)
catch
(
SystemError
&
err
)
...
@@ -489,10 +497,10 @@ void UObject_SK::setMsg( UniSetTypes::ObjectId _code, bool _state )
...
@@ -489,10 +497,10 @@ void UObject_SK::setMsg( UniSetTypes::ObjectId _code, bool _state )
if
(
!
_state
)
if
(
!
_state
)
{
{
ptResetMsg
.
reset
();
ptResetMsg
.
reset
();
return
;
return
;
}
}
alarm
(
_code
,
_state
);
alarm
(
_code
,
_state
);
ptResetMsg
.
reset
();
ptResetMsg
.
reset
();
}
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
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"
)
{
{
}
}
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
...
@@ -154,14 +154,14 @@ UniSetManager::~UniSetManager()
...
@@ -154,14 +154,14 @@ UniSetManager::~UniSetManager()
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
void
UniSetManager
::
initPOA
(
const
std
::
weak_ptr
<
UniSetManager
>&
rmngr
)
void
UniSetManager
::
initPOA
(
const
std
::
weak_ptr
<
UniSetManager
>&
rmngr
)
{
{
auto
m
=
rmngr
.
lock
();
auto
m
=
rmngr
.
lock
();
if
(
!
m
)
if
(
!
m
)
{
{
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(initPOA): failed weak_ptr !!"
;
err
<<
myname
<<
"(initPOA): failed weak_ptr !!"
;
ucrit
<<
err
.
str
()
<<
endl
;
ucrit
<<
err
.
str
()
<<
endl
;
throw
SystemError
(
err
.
str
());
throw
SystemError
(
err
.
str
());
}
}
if
(
CORBA
::
is_nil
(
pman
)
)
if
(
CORBA
::
is_nil
(
pman
)
)
this
->
pman
=
m
->
getPOAManager
();
this
->
pman
=
m
->
getPOAManager
();
...
@@ -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
...
@@ -331,7 +331,7 @@ void UniSetObject::registered()
...
@@ -331,7 +331,7 @@ void UniSetObject::registered()
return
;
return
;
}
}
auto
m
=
mymngr
.
lock
();
auto
m
=
mymngr
.
lock
();
if
(
!
m
)
if
(
!
m
)
{
{
uwarn
<<
myname
<<
"(registered): unknown my manager"
<<
endl
;
uwarn
<<
myname
<<
"(registered): unknown my manager"
<<
endl
;
...
@@ -635,25 +635,25 @@ bool UniSetObject::deactivate()
...
@@ -635,25 +635,25 @@ bool UniSetObject::deactivate()
{
{
uinfo
<<
myname
<<
"(deactivate): ..."
<<
endl
;
uinfo
<<
myname
<<
"(deactivate): ..."
<<
endl
;
auto
m
=
mymngr
.
lock
();
auto
m
=
mymngr
.
lock
();
if
(
m
)
if
(
m
)
{
{
PortableServer
::
POA_var
poamngr
=
m
->
getPOA
();
PortableServer
::
POA_var
poamngr
=
m
->
getPOA
();
if
(
!
PortableServer
::
POA_Helper
::
is_nil
(
poamngr
)
)
if
(
!
PortableServer
::
POA_Helper
::
is_nil
(
poamngr
)
)
{
{
try
try
{
{
deactivateObject
();
deactivateObject
();
}
}
catch
(...){}
catch
(...){}
unregister
();
unregister
();
PortableServer
::
ObjectId_var
oid
=
poamngr
->
servant_to_id
(
static_cast
<
PortableServer
::
ServantBase
*>
(
this
));
PortableServer
::
ObjectId_var
oid
=
poamngr
->
servant_to_id
(
static_cast
<
PortableServer
::
ServantBase
*>
(
this
));
poamngr
->
deactivate_object
(
oid
);
poamngr
->
deactivate_object
(
oid
);
uinfo
<<
myname
<<
"(disacivate): finished..."
<<
endl
;
uinfo
<<
myname
<<
"(disacivate): finished..."
<<
endl
;
return
true
;
return
true
;
}
}
}
}
uwarn
<<
myname
<<
"(deactivate): manager already destroyed.."
<<
endl
;
uwarn
<<
myname
<<
"(deactivate): manager already destroyed.."
<<
endl
;
}
}
...
@@ -686,12 +686,12 @@ bool UniSetObject::activate()
...
@@ -686,12 +686,12 @@ bool UniSetObject::activate()
{
{
uinfo
<<
myname
<<
": activate..."
<<
endl
;
uinfo
<<
myname
<<
": activate..."
<<
endl
;
auto
m
=
mymngr
.
lock
();
auto
m
=
mymngr
.
lock
();
if
(
!
m
)
if
(
!
m
)
{
{
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(activate): mymngr=NULL!!! activate failure..."
;
err
<<
myname
<<
"(activate): mymngr=NULL!!! activate failure..."
;
ucrit
<<
err
.
str
()
<<
endl
;
ucrit
<<
err
.
str
()
<<
endl
;
throw
SystemError
(
err
.
str
());
throw
SystemError
(
err
.
str
());
}
}
...
...
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