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
- ТЕСТЫ! ТЕСТЫ! ТЕСТЫ!
- Перевести взаимодействие PassiveObject <--> ProxyManager на shared_ptr (или weak_ptr).
Version 2.1
============
...
...
@@ -48,6 +50,10 @@ Version 2.1
- IOBase: возможность задавать свою формулу преобразования входного сигнала (помимо калибровки)..
- переписать систему инициализации и работы между UniSetActivator,UniSetManager и UniSetObject-ами
(уменьшить количество функций (связность) и определится с кто отвечает за удаление объекта и т.п.)
version 3
=========
...
...
Utilities/Admin/admin.cc
View file @
055a718a
...
...
@@ -339,8 +339,8 @@ int main(int argc, char** argv)
// ==============================================================================================
static
bool
commandToAll
(
const
string
&
section
,
ObjectRepository
*
rep
,
Command
cmd
)
{
if
(
verb
)
cout
<<
"
\n
||=======******** "
<<
section
<<
" ********=========||
\n
"
<<
endl
;
if
(
verb
)
cout
<<
"
\n
||=======******** "
<<
section
<<
" ********=========||
\n
"
<<
endl
;
try
{
...
...
@@ -407,7 +407,7 @@ static bool commandToAll(const string& section, ObjectRepository *rep, Command c
if
(
obj
->
exist
()
)
cout
<<
setw
(
55
)
<<
ob
<<
" <--- exist ok
\n
"
;
else
cout
<<
setw
(
55
)
<<
ob
<<
" <--- exist NOT OK
\n
"
;
cout
<<
setw
(
55
)
<<
ob
<<
" <--- exist NOT OK
\n
"
;
}
break
;
...
...
@@ -585,16 +585,16 @@ int getValue( const string& args, UInterface &ui )
break
;
default:
if
(
!
quiet
)
cerr
<<
"FAILED: Unknown 'iotype' for "
<<
it
->
fname
<<
endl
;
if
(
!
quiet
)
cerr
<<
"FAILED: Unknown 'iotype' for "
<<
it
->
fname
<<
endl
;
err
=
1
;
break
;
}
}
catch
(
Exception
&
ex
)
{
if
(
!
quiet
)
cerr
<<
"(getValue): "
<<
ex
<<
endl
;
if
(
!
quiet
)
cerr
<<
"(getValue): "
<<
ex
<<
endl
;
err
=
1
;
}
}
...
...
@@ -747,8 +747,8 @@ int oinfo( const string& arg, UInterface &ui )
UniSetTypes
::
ObjectId
oid
(
uni_atoi
(
arg
));
if
(
oid
==
0
)
{
if
(
!
quiet
)
cout
<<
"(oinfo): Не задан OID!"
<<
endl
;
if
(
!
quiet
)
cout
<<
"(oinfo): Не задан OID!"
<<
endl
;
return
1
;
}
...
...
Utilities/NullController/main.cc
View file @
055a718a
...
...
@@ -73,7 +73,7 @@ int main(int argc, char** argv)
NullController
nc
(
ID
,
askfile
,
s_field
,
s_fvalue
,
c_field
,
c_fvalue
,
dbDumping
);
UniSetActivatorPtr
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
nc
.
get_ptr
()
);
act
->
add
(
nc
.
get_ptr
()
);
act
->
run
(
false
);
return
0
;
}
...
...
Utilities/SMonit/smonitor.cc
View file @
055a718a
...
...
@@ -36,7 +36,7 @@ int main( int argc, const char **argv )
UniSetActivatorPtr
act
=
UniSetActivator
::
Instance
();
SMonitor
tp
(
ID
);
act
->
add
Object
(
tp
.
get_ptr
());
act
->
add
(
tp
.
get_ptr
());
SystemMessage
sm
(
SystemMessage
::
StartUp
);
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[] )
obj.mylog.logFile( logname.c_str() );
auto act = UniSetActivator::Instance();
act-
>
add
Object(static_cast
<
class UniSetObject*
>
(
&
obj
));
act-
>
add
(obj.get_ptr(
));
SystemMessage sm(SystemMessage::StartUp);
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 )
</xsl:if>
auto act = UniSetActivator::Instance();
act-
>
add
Object(static_cast
<
class UniSetObject*
>
(
&
obj
));
act-
>
add
(obj.get_ptr(
));
SystemMessage sm(SystemMessage::StartUp);
act-
>
broadcast( sm.transport_msg() );
...
...
Utilities/codegen/skel-main.cc
View file @
055a718a
...
...
@@ -26,7 +26,7 @@ int main( int argc, const char **argv )
}
Skel
o
(
"Skel"
,
cnode
);
act
.
add
Object
(
static_cast
<
UniSetObject
*>
(
&
o
)
);
act
.
add
(
o
.
get_ptr
()
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
.
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/DBServer-MySQL/main.cc
View file @
055a718a
...
...
@@ -54,7 +54,7 @@ int main(int argc, char** argv)
DBServer_MySQL
dbs
(
ID
);
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
dbs
.
get_ptr
());
act
->
add
(
dbs
.
get_ptr
());
act
->
run
(
false
);
}
catch
(
Exception
&
ex
)
...
...
extensions/DBServer-SQLite/main.cc
View file @
055a718a
...
...
@@ -55,7 +55,7 @@ int main(int argc, char** argv)
DBServer_SQLite
dbs
(
ID
);
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
dbs
.
get_ptr
());
act
->
add
(
dbs
.
get_ptr
());
act
->
run
(
false
);
}
catch
(
Exception
&
ex
)
...
...
extensions/IOControl/iocontrol.cc
View file @
055a718a
...
...
@@ -53,7 +53,7 @@ int main(int argc, const char **argv)
}
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
ic
);
act
->
add
(
ic
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/LogicProcessor/plogicproc.cc
View file @
055a718a
...
...
@@ -71,7 +71,7 @@ int main(int argc, const char **argv)
PassiveLProcessor
plc
(
schema
,
ID
,
shmID
);
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
plc
.
get_ptr
());
act
->
add
(
plc
.
get_ptr
());
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/ModbusMaster/main.cc
View file @
055a718a
...
...
@@ -59,7 +59,7 @@ int main( int argc, const char** argv )
}
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
mb
);
act
->
add
(
mb
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/ModbusMaster/multi-main.cc
View file @
055a718a
...
...
@@ -58,7 +58,7 @@ int main( int argc, const char** argv )
}
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
mb
);
act
->
add
(
mb
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/ModbusMaster/rtuexchange.cc
View file @
055a718a
...
...
@@ -57,7 +57,7 @@ int main( int argc, char** argv )
}
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
rs
);
act
->
add
(
rs
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
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[] )
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
shm
);
act
->
add
Object
(
mb
);
act
->
add
(
shm
);
act
->
add
(
mb
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
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[] )
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
shm
);
act
->
add
Object
(
mb
);
act
->
add
(
shm
);
act
->
add
(
mb
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/ModbusSlave/mbslave.cc
View file @
055a718a
...
...
@@ -63,7 +63,7 @@ int main(int argc, const char **argv)
}
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
s
);
act
->
add
(
s
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/ModbusSlave/mbtcp-multislave.cc
View file @
055a718a
...
...
@@ -63,7 +63,7 @@ int main(int argc, const char **argv)
}
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
s
);
act
->
add
(
s
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
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[] )
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
shm
);
act
->
add
Object
(
mbs
);
act
->
add
(
shm
);
act
->
add
(
mbs
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/RRDServer/main.cc
View file @
055a718a
...
...
@@ -59,7 +59,7 @@ int main( int argc, const char** argv )
}
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
db
);
act
->
add
(
db
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/SMDBServer/main.cc
View file @
055a718a
...
...
@@ -23,8 +23,7 @@ int main( int argc, const char** argv )
try
{
string
confile
=
UniSetTypes
::
getArgParam
(
"--confile"
,
argc
,
argv
,
"configure.xml"
);
conf
=
new
Configuration
(
argc
,
argv
,
confile
);
auto
conf
=
uniset_init
(
argc
,
argv
,
confile
);
string
logfilename
(
conf
->
getArgParam
(
"--smdbserver-logfile"
));
if
(
logfilename
.
empty
()
)
...
...
@@ -51,24 +50,24 @@ int main( int argc, const char** argv )
return
1
;
}
SMDBServer
*
db
=
SMDBServer
::
init_smdbserver
(
argc
,
argv
,
shmID
);
auto
db
=
SMDBServer
::
init_smdbserver
(
argc
,
argv
,
shmID
);
if
(
!
db
)
{
dcrit
<<
"(smdbserver): init не прошёл..."
<<
endl
;
return
1
;
}
UniSetActivator
act
;
act
.
addObject
(
static_cast
<
class
UniSetObject
*>
(
db
)
);
auto
act
=
UniSetActivator
::
Instance
()
;
act
->
add
(
db
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
.
broadcast
(
sm
.
transport_msg
()
);
act
->
broadcast
(
sm
.
transport_msg
()
);
ulog
<<
"
\n\n\n
"
;
ulog
<<
"(main): -------------- SMDBServer START -------------------------
\n\n
"
;
dlog
<<
"
\n\n\n
"
;
dlog
<<
"(main): -------------- SMDBServer START -------------------------
\n\n
"
;
act
.
run
(
false
);
act
->
run
(
false
);
return
0
;
}
catch
(
Exception
&
ex
)
...
...
extensions/SharedMemory/smemory.cc
View file @
055a718a
...
...
@@ -33,9 +33,9 @@ int main(int argc, const char **argv)
if
(
!
shm
)
return
1
;
UniSetActivatorPtr
act
=
UniSetActivator
::
Instance
();
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
shm
);
// ->get_ptr()
);
act
->
add
(
shm
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
run
(
false
);
...
...
extensions/SharedMemoryPlus/smemory-plus.cc
View file @
055a718a
...
...
@@ -83,7 +83,7 @@ int main( int argc, const char **argv )
if
(
!
shm
)
return
1
;
act
->
add
Manager
(
shm
);
act
->
add
(
shm
);
#ifdef UNISET_ENABLE_IO
// ------------ IOControl ----------------
...
...
@@ -113,7 +113,7 @@ int main( int argc, const char **argv )
if
(
io_thr
==
NULL
)
return
1
;
act
->
add
Object
(
ic
);
act
->
add
(
ic
);
lst_iothr
.
push_back
(
io_thr
);
}
}
...
...
@@ -139,7 +139,7 @@ int main( int argc, const char **argv )
if
(
!
rtu
)
return
1
;
act
->
add
Object
(
rtu
);
act
->
add
(
rtu
);
}
}
// ------------- MBSlave --------------
...
...
@@ -163,7 +163,7 @@ int main( int argc, const char **argv )
if
(
!
mbs
)
return
1
;
act
->
add
Object
(
mbs
);
act
->
add
(
mbs
);
}
}
...
...
@@ -189,7 +189,7 @@ int main( int argc, const char **argv )
if
(
!
mbm1
)
return
1
;
act
->
add
Object
(
mbm1
);
act
->
add
(
mbm1
);
}
}
// ------------- UNetUDP --------------
...
...
@@ -203,7 +203,7 @@ int main( int argc, const char **argv )
if
(
dlog
.
is_info
()
)
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[] )
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
shm
);
act
->
add
Object
(
unet
);
act
->
add
(
shm
);
act
->
add
(
unet
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/UNetUDP/unetexchange.cc
View file @
055a718a
...
...
@@ -57,7 +57,7 @@ int main( int argc, const char** argv )
}
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
unet
);
act
->
add
(
unet
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
...
...
extensions/UniNetwork/uninet.cc
View file @
055a718a
...
...
@@ -46,7 +46,7 @@ int main(int argc, const char **argv)
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
uex
);
act
->
add
(
uex
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
run
(
true
);
...
...
extensions/include/UObject_SK.h
View file @
055a718a
...
...
@@ -8,7 +8,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/
// --------------------------------------------------------------------------
// generate timestamp: 201
4-11-30
+03:00
// generate timestamp: 201
5-01-12
+03:00
// -----------------------------------------------------------------------------
#ifndef UObject_SK_H_
#define UObject_SK_H_
...
...
@@ -29,7 +29,7 @@ class UObject_SK:
UObject_SK
();
virtual
~
UObject_SK
();
bool
alarm
(
UniSetTypes
::
ObjectId
sid
,
bool
state
);
long
getValue
(
UniSetTypes
::
ObjectId
sid
);
void
setValue
(
UniSetTypes
::
ObjectId
sid
,
long
value
);
...
...
@@ -56,26 +56,26 @@ class UObject_SK:
// Используемые идентификаторы
// Используемые идентификаторы сообщений
// Текущее значение
// --- public variables ---
// --- end of public variables ---
protected
:
// --- protected variables ---
// ---- end of protected variables ----
virtual
void
callback
()
override
;
virtual
void
processingMessage
(
UniSetTypes
::
VoidMessage
*
msg
)
override
;
virtual
void
sysCommand
(
const
UniSetTypes
::
SystemMessage
*
sm
)
override
;
...
...
@@ -111,7 +111,7 @@ class UObject_SK:
PassiveTimer
ptHeartBeat
;
/*! < период "сердцебиения" */
UniSetTypes
::
ObjectId
idHeartBeat
;
/*! < идентификатор датчика (AI) "сердцебиения" */
int
maxHeartBeat
;
/*! < сохраняемое значение */
xmlNode
*
confnode
;
/*! получить числовое свойство из конф. файла по привязанной confnode */
int
getIntProp
(
const
std
::
string
&
name
)
{
return
UniSetTypes
::
uniset_conf
()
->
getIntProp
(
confnode
,
name
);
}
...
...
@@ -123,20 +123,21 @@ class UObject_SK:
int
activateTimeout
;
/*!< время ожидания готовности UniSetObject к работе */
PassiveTimer
ptStartUpTimeout
;
/*!< время на блокировку обработки WatchDog, если недавно был StartUp */
int
askPause
;
/*!< пауза между неудачными попытками заказать датчики */
IOController_i
::
SensorInfo
si
;
bool
forceOut
;
/*!< флаг принудительного обноления "выходов" */
private
:
// --- private variables ---
// --- end of private variables ---
// предыдущее значение (для работы UpdateValue())
// Используемые идентификаторы сообщений
bool
end_private
;
// вспомогательное поле (для внутреннего использования при генерировании кода)
};
...
...
extensions/lib/UObject_SK.cc
View file @
055a718a
...
...
@@ -11,7 +11,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/
// --------------------------------------------------------------------------
// generate timestamp: 201
4-11-30
+03:00
// generate timestamp: 201
5-01-12
+03:00
// -----------------------------------------------------------------------------
#include "Configuration.h"
#include "Exceptions.h"
...
...
@@ -40,6 +40,7 @@ confnode(0),
smReadyTimeout
(
0
),
activated
(
false
),
askPause
(
2000
),
forceOut
(
false
),
end_private
(
false
)
{
...
...
@@ -54,7 +55,7 @@ static const std::string init3_str( const std::string& s1, const std::string& s2
return
s1
;
if
(
!
s2
.
empty
()
)
return
s2
;
return
s3
;
}
// -----------------------------------------------------------------------------
...
...
@@ -75,12 +76,13 @@ confnode(cnode),
smReadyTimeout
(
0
),
activated
(
false
),
askPause
(
uniset_conf
()
->
getPIntProp
(
cnode
,
"askPause"
,
2000
)),
forceOut
(
false
),
end_private
(
false
)
{
auto
conf
=
uniset_conf
();
if
(
UniSetTypes
::
findArgParam
(
"--print-id-list"
,
uniset_conf
()
->
getArgc
(),
uniset_conf
()
->
getArgv
())
!=
-
1
)
{
...
...
@@ -97,8 +99,14 @@ end_private(false)
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
()
)
{
idHeartBeat
=
conf
->
getSensorID
(
heart
);
...
...
@@ -109,39 +117,39 @@ end_private(false)
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
)
ptHeartBeat
.
setTiming
(
heartbeatTime
);
else
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
);
ptResetMsg
.
setTiming
(
resetMsgTime
);
smReadyTimeout
=
conf
->
getArgInt
(
"--sm-ready-timeout"
,
""
);
smReadyTimeout
=
conf
->
getArgInt
(
"--
"
+
argprefix
+
"
sm-ready-timeout"
,
""
);
if
(
smReadyTimeout
==
0
)
smReadyTimeout
=
60000
;
else
if
(
smReadyTimeout
<
0
)
smReadyTimeout
=
UniSetTimer
::
WaitUpTime
;
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
(
"--startup-timeout"
,
10000
);
int
msec
=
conf
->
getArgPInt
(
"--"
+
argprefix
+
"startup-timeout"
,
10000
);
ptStartUpTimeout
.
setTiming
(
msec
);
// ===================== <variables> =====================
// ===================== end of <variables> =====================
}
...
...
@@ -154,17 +162,17 @@ UObject_SK::~UObject_SK()
void
UObject_SK
::
updateValues
()
{
// Опрашиваем все входы...
}
// -----------------------------------------------------------------------------
void
UObject_SK
::
updatePreviousValues
()
{
}
// -----------------------------------------------------------------------------
void
UObject_SK
::
checkSensors
()
{
}
// -----------------------------------------------------------------------------
bool
UObject_SK
::
alarm
(
UniSetTypes
::
ObjectId
_code
,
bool
_state
)
...
...
@@ -174,13 +182,13 @@ bool UObject_SK::alarm( UniSetTypes::ObjectId _code, bool _state )
ucrit
<<
getName
()
<<
"(alarm): попытка послать сообщение с DefaultObjectId"
<<
endl
;
return
false
;
return
false
;
}
ulog1
<<
getName
()
<<
"(alarm): "
<<
(
_state
?
"SEND "
:
"RESET "
)
<<
endl
;
ulog1
<<
" not found MessgeOID?!!"
<<
endl
;
return
false
;
}
...
...
@@ -197,7 +205,7 @@ void UObject_SK::testMode( bool _state )
return
;
// отключаем все выходы
}
// -----------------------------------------------------------------------------
...
...
@@ -229,7 +237,7 @@ void UObject_SK::processingMessage( UniSetTypes::VoidMessage* _msg )
default
:
break
;
}
}
}
catch
(
Exception
&
ex
)
{
...
...
@@ -261,13 +269,13 @@ void UObject_SK::sysCommand( const SystemMessage* _sm )
active
=
true
;
break
;
}
case
SystemMessage
:
:
FoldUp
:
case
SystemMessage
:
:
Finish
:
preAskSensors
(
UniversalIO
::
UIODontNotify
);
askSensors
(
UniversalIO
::
UIODontNotify
);
break
;
case
SystemMessage
:
:
LogRotate
:
{
// переоткрываем логи
...
...
@@ -295,7 +303,7 @@ void UObject_SK::sigterm( int signo )
// -----------------------------------------------------------------------------
bool
UObject_SK
::
activateObject
()
{
// блокирование обработки Startup
// блокирование обработки Startup
// пока не пройдёт инициализация датчиков
// см. sysCommand()
{
...
...
@@ -321,16 +329,16 @@ void UObject_SK::waitSM( int wait_msec, ObjectId _testID )
if
(
_testID
==
DefaultObjectId
)
return
;
uinfo
<<
myname
<<
"(waitSM): waiting SM ready "
<<
wait_msec
<<
" msec"
<<
" testID="
<<
_testID
<<
endl
;
if
(
!
ui
.
waitReady
(
_testID
,
wait_msec
)
)
{
ostringstream
err
;
err
<<
myname
<<
"(waitSM): Не дождались готовности(exist) SharedMemory к работе в течение "
err
<<
myname
<<
"(waitSM): Не дождались готовности(exist) SharedMemory к работе в течение "
<<
wait_msec
<<
" мсек"
;
ucrit
<<
err
.
str
()
<<
endl
;
...
...
@@ -367,7 +375,7 @@ void UObject_SK::callback()
if
(
!
receiveMessage
(
msg
)
)
break
;
processingMessage
(
&
msg
);
updateOutputs
(
f
alse
);
updateOutputs
(
f
orceOut
);
// updatePreviousValues();
}
...
...
@@ -382,7 +390,7 @@ void UObject_SK::callback()
}
// обновление выходов
updateOutputs
(
f
alse
);
updateOutputs
(
f
orceOut
);
updatePreviousValues
();
}
catch
(
Exception
&
ex
)
...
...
@@ -401,26 +409,26 @@ void UObject_SK::callback()
if
(
!
active
)
return
;
msleep
(
sleep_msec
);
}
// -----------------------------------------------------------------------------
void
UObject_SK
::
setValue
(
UniSetTypes
::
ObjectId
_sid
,
long
_val
)
{
ui
.
setValue
(
_sid
,
_val
);
}
// -----------------------------------------------------------------------------
void
UObject_SK
::
updateOutputs
(
bool
_force
)
{
}
// -----------------------------------------------------------------------------
void
UObject_SK
::
preSensorInfo
(
const
UniSetTypes
::
SensorMessage
*
_sm
)
{
sensorInfo
(
_sm
);
}
// -----------------------------------------------------------------------------
...
...
@@ -449,13 +457,13 @@ void UObject_SK::preAskSensors( UniversalIO::UIOCommand _cmd )
{
PassiveTimer
ptAct
(
activateTimeout
);
while
(
!
activated
&&
!
ptAct
.
checkTime
()
)
{
{
cout
<<
myname
<<
"(preAskSensors): wait activate..."
<<
endl
;
msleep
(
300
);
if
(
activated
)
break
;
}
if
(
!
activated
)
ucrit
<<
myname
<<
"(preAskSensors): ************* don`t activated?! ************"
<<
endl
;
...
...
@@ -464,7 +472,7 @@ void UObject_SK::preAskSensors( UniversalIO::UIOCommand _cmd )
{
try
{
return
;
}
catch
(
SystemError
&
err
)
...
...
@@ -489,10 +497,10 @@ void UObject_SK::setMsg( UniSetTypes::ObjectId _code, bool _state )
if
(
!
_state
)
{
ptResetMsg
.
reset
();
return
;
return
;
}
alarm
(
_code
,
_state
);
ptResetMsg
.
reset
();
}
}
// ----------------------------------------------------------------------------
extensions/tests/SMemoryTest/smemory-test.cc
View file @
055a718a
...
...
@@ -29,13 +29,13 @@ int main(int argc, const char **argv)
ulog
.
logFile
(
logname
);
dlog
.
logFile
(
logname
);
SharedMemory
*
shm
=
SharedMemory
::
init_smemory
(
argc
,
argv
);
auto
shm
=
SharedMemory
::
init_smemory
(
argc
,
argv
);
if
(
!
shm
)
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
);
...
...
@@ -47,7 +47,7 @@ int main(int argc, const char **argv)
cout
<<
"..create "
<<
s
.
str
()
<<
endl
;
TestProc
*
tp
=
new
TestProc
(
conf
->
getObjectID
(
s
.
str
()));
tp
->
init_dlog
(
dlog
);
act
->
add
Object
(
static_cast
<
class
UniSetObject
*>
(
tp
));
act
->
add
(
tp
->
get_ptr
(
));
}
SystemMessage
sm
(
SystemMessage
::
StartUp
);
...
...
extensions/tests/tests_with_sm.cc
View file @
055a718a
...
...
@@ -70,7 +70,7 @@ int main(int argc, char* argv[] )
auto
act
=
UniSetActivator
::
Instance
();
act
->
add
Object
(
shm
);
act
->
add
(
shm
);
SystemMessage
sm
(
SystemMessage
::
StartUp
);
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
run
(
true
);
...
...
include/UniSetActivator.h
View file @
055a718a
...
...
@@ -69,7 +69,7 @@ class UniSetActivator:
virtual
void
oaDestroy
(
int
signo
=
0
);
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"
);
}
...
...
@@ -114,7 +114,6 @@ class UniSetActivator:
private
:
// static void processingSignal(int signo);
static
void
terminated
(
int
signo
);
static
void
finishterm
(
int
signo
);
static
void
normalexit
();
...
...
@@ -123,8 +122,7 @@ class UniSetActivator:
void
term
(
int
signo
);
void
init
();
friend
class
ThreadCreator
<
UniSetActivator
>
;
ThreadCreator
<
UniSetActivator
>
*
orbthr
;
std
::
shared_ptr
<
ThreadCreator
<
UniSetActivator
>
>
orbthr
;
CORBA
::
ORB_var
orb
;
TerminateEvent_Signal
s_term
;
...
...
@@ -132,31 +130,6 @@ class UniSetActivator:
bool
omDestroy
;
bool
sig
;
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:
virtual
UniSetTypes
::
SimpleInfoSeq
*
getObjectsInfo
(
CORBA
::
Long
MaxLength
=
300
)
override
;
// --------------------------
void
initPOA
(
const
std
::
weak_ptr
<
UniSetManager
>&
rmngr
);
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
);
virtual
bool
add
(
const
std
::
shared_ptr
<
UniSetObject
>&
obj
);
virtual
bool
remove
(
const
std
::
shared_ptr
<
UniSetObject
>&
obj
);
// --------------------------
/*! Получение доступа к подчиненному менеджеру по идентификатору
* \return
объект ненайден будет возвращен 0.
* \return
shared_ptr<>, если объект не найден будет возвращен shared_ptr<> = nullptr
*/
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
);
// Функции для аботы со списками подчиненных объектов
inline
UniSetManagerList
::
const_iterator
beginMList
()
{
...
...
@@ -122,6 +115,11 @@ class 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
};
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
OManagerCommand
&
cmd
);
...
...
@@ -132,6 +130,8 @@ class UniSetManager:
virtual
void
sigterm
(
int
signo
)
override
;
void
initPOA
(
const
std
::
weak_ptr
<
UniSetManager
>&
rmngr
);
//! \note Переопределяя не забывайте вызвать базовую
virtual
bool
activateObject
()
override
;
//! \note Переопределяя не забывайте вызвать базовую
...
...
@@ -147,8 +147,6 @@ class UniSetManager:
private
:
friend
class
UniSetActivator
;
int
sig
;
UniSetManagerList
mlist
;
ObjectsList
olist
;
...
...
src/ObjectRepository/UniSetActivator.cc
View file @
055a718a
...
...
@@ -98,7 +98,6 @@ void UniSetActivator::Destroy()
// ---------------------------------------------------------------------------
UniSetActivator
::
UniSetActivator
(
const
ObjectId
id
)
:
UniSetManager
(
id
),
orbthr
(
0
),
omDestroy
(
false
),
sig
(
false
)
{
...
...
@@ -107,7 +106,6 @@ sig(false)
// ------------------------------------------------------------------------------------------
UniSetActivator
::
UniSetActivator
()
:
UniSetManager
(
UniSetTypes
::
DefaultObjectId
),
orbthr
(
0
),
omDestroy
(
false
),
sig
(
false
)
{
...
...
@@ -146,8 +144,7 @@ UniSetActivator::~UniSetActivator()
if
(
orbthr
->
isRunning
()
)
orbthr
->
join
();
delete
orbthr
;
orbthr
=
0
;
orbthr
.
reset
();
}
if
(
!
procterm
)
...
...
@@ -205,7 +202,6 @@ void UniSetActivator::oaDestroy(int signo)
pman
->
deactivate
(
false
,
true
);
ulogsys
<<
myname
<<
"(oaDestroy): pman deactivate ok. "
<<
endl
;
ulogsys
<<
myname
<<
"(oaDestroy): orbthr="
<<
orbthr
<<
endl
;
if
(
orbthr
)
{
try
...
...
@@ -263,7 +259,6 @@ void UniSetActivator::run( bool thread )
UniSetManager
::
activate
();
// а там вызывается активация всех подчиненных объектов и менеджеров
getinfo
();
// заполнение информации об объектах
active
=
true
;
ulogsys
<<
myname
<<
"(run): активизируем менеджер"
<<
endl
;
...
...
@@ -274,7 +269,7 @@ void UniSetActivator::run( bool thread )
if
(
thread
)
{
uinfo
<<
myname
<<
"(run): запускаемся с созданием отдельного потока... "
<<
endl
;
orbthr
=
new
ThreadCreator
<
UniSetActivator
>
(
this
,
&
UniSetActivator
::
work
);
orbthr
=
make_shared
<
ThreadCreator
<
UniSetActivator
>
>
(
this
,
&
UniSetActivator
::
work
);
int
ret
=
orbthr
->
start
();
if
(
ret
!=
0
)
{
...
...
@@ -327,7 +322,7 @@ void UniSetActivator::stop()
void
UniSetActivator
::
work
()
{
ulogsys
<<
myname
<<
"(work): запускаем orb на обработку запросов...
(orbthr="
<<
orbthr
<<
")
"
<<
endl
;
ulogsys
<<
myname
<<
"(work): запускаем orb на обработку запросов..."
<<
endl
;
try
{
if
(
orbthr
)
...
...
@@ -371,15 +366,6 @@ void UniSetActivator::work()
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
)
{
switch
(
sm
->
command
)
...
...
@@ -541,8 +527,7 @@ void UniSetActivator::term( int signo )
if
(
orbthr
->
isRunning
()
)
orbthr
->
join
();
delete
orbthr
;
orbthr
=
0
;
orbthr
.
reset
();
}
sigterm
(
signo
);
...
...
src/ObjectRepository/UniSetManager.cc
View file @
055a718a
...
...
@@ -88,8 +88,8 @@ class OPush: public unary_function< const std::shared_ptr<UniSetObject>& , bool>
UniSetManager
::
UniSetManager
()
:
UniSetObject
(
UniSetTypes
::
DefaultObjectId
),
sig
(
0
),
olistMutex
(
"olistMutex"
),
mlistMutex
(
"mlistMutex"
)
olistMutex
(
"
UniSetManager_
olistMutex"
),
mlistMutex
(
"
UniSetManager_
mlistMutex"
)
{
}
// ------------------------------------------------------------------------------------------
...
...
@@ -154,14 +154,14 @@ UniSetManager::~UniSetManager()
// ------------------------------------------------------------------------------------------
void
UniSetManager
::
initPOA
(
const
std
::
weak_ptr
<
UniSetManager
>&
rmngr
)
{
auto
m
=
rmngr
.
lock
();
if
(
!
m
)
{
ostringstream
err
;
err
<<
myname
<<
"(initPOA): failed weak_ptr !!"
;
ucrit
<<
err
.
str
()
<<
endl
;
throw
SystemError
(
err
.
str
());
}
auto
m
=
rmngr
.
lock
();
if
(
!
m
)
{
ostringstream
err
;
err
<<
myname
<<
"(initPOA): failed weak_ptr !!"
;
ucrit
<<
err
.
str
()
<<
endl
;
throw
SystemError
(
err
.
str
());
}
if
(
CORBA
::
is_nil
(
pman
)
)
this
->
pman
=
m
->
getPOAManager
();
...
...
@@ -179,8 +179,27 @@ void UniSetManager::initPOA( const std::weak_ptr<UniSetManager>& rmngr )
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
)
{
{
//lock
uniset_rwmutex_wrlock
lock
(
olistMutex
);
auto
li
=
find
(
olist
.
begin
(),
olist
.
end
(),
obj
);
...
...
@@ -493,11 +512,8 @@ int UniSetManager::objectsCount()
{
int
res
(
olist
.
size
()
+
mlist
.
size
()
);
for
(
UniSetManagerList
::
const_iterator
it
=
beginMList
();
it
!=
endMList
();
++
it
)
{
res
+=
(
*
it
)
->
objectsCount
();
}
for
(
auto
i
:
mlist
)
res
+=
i
->
objectsCount
();
return
res
;
}
...
...
@@ -541,9 +557,9 @@ int UniSetManager::getObjectsInfo( const std::shared_ptr<UniSetManager>& mngr, S
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
)
break
;
}
...
...
src/ObjectRepository/UniSetObject.cc
View file @
055a718a
...
...
@@ -331,7 +331,7 @@ void UniSetObject::registered()
return
;
}
auto
m
=
mymngr
.
lock
();
auto
m
=
mymngr
.
lock
();
if
(
!
m
)
{
uwarn
<<
myname
<<
"(registered): unknown my manager"
<<
endl
;
...
...
@@ -635,25 +635,25 @@ bool UniSetObject::deactivate()
{
uinfo
<<
myname
<<
"(deactivate): ..."
<<
endl
;
auto
m
=
mymngr
.
lock
();
if
(
m
)
{
PortableServer
::
POA_var
poamngr
=
m
->
getPOA
();
if
(
!
PortableServer
::
POA_Helper
::
is_nil
(
poamngr
)
)
{
try
{
deactivateObject
();
}
catch
(...){}
unregister
();
PortableServer
::
ObjectId_var
oid
=
poamngr
->
servant_to_id
(
static_cast
<
PortableServer
::
ServantBase
*>
(
this
));
poamngr
->
deactivate_object
(
oid
);
uinfo
<<
myname
<<
"(disacivate): finished..."
<<
endl
;
return
true
;
}
}
auto
m
=
mymngr
.
lock
();
if
(
m
)
{
PortableServer
::
POA_var
poamngr
=
m
->
getPOA
();
if
(
!
PortableServer
::
POA_Helper
::
is_nil
(
poamngr
)
)
{
try
{
deactivateObject
();
}
catch
(...){}
unregister
();
PortableServer
::
ObjectId_var
oid
=
poamngr
->
servant_to_id
(
static_cast
<
PortableServer
::
ServantBase
*>
(
this
));
poamngr
->
deactivate_object
(
oid
);
uinfo
<<
myname
<<
"(disacivate): finished..."
<<
endl
;
return
true
;
}
}
uwarn
<<
myname
<<
"(deactivate): manager already destroyed.."
<<
endl
;
}
...
...
@@ -686,12 +686,12 @@ bool UniSetObject::activate()
{
uinfo
<<
myname
<<
": activate..."
<<
endl
;
auto
m
=
mymngr
.
lock
();
auto
m
=
mymngr
.
lock
();
if
(
!
m
)
{
ostringstream
err
;
err
<<
myname
<<
"(activate): mymngr=NULL!!! activate failure..."
;
ucrit
<<
err
.
str
()
<<
endl
;
ostringstream
err
;
err
<<
myname
<<
"(activate): mymngr=NULL!!! activate failure..."
;
ucrit
<<
err
.
str
()
<<
endl
;
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