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
cadcafc2
Commit
cadcafc2
authored
Sep 30, 2017
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Убрал спецификации исключений в функциях, в соответсвии с
E.30 (C++ Core Guidelines)
parent
2cd26e77
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
160 additions
and
179 deletions
+160
-179
ComediInterface.cc
extensions/IOControl/ComediInterface.cc
+1
-6
ComediInterface.h
extensions/IOControl/ComediInterface.h
+12
-12
FakeIOControl.cc
extensions/IOControl/tests/FakeIOControl.cc
+0
-6
FakeIOControl.h
extensions/IOControl/tests/FakeIOControl.h
+6
-12
RTUStorage.cc
extensions/ModbusMaster/RTUStorage.cc
+1
-1
RTUStorage.h
extensions/ModbusMaster/RTUStorage.h
+2
-2
CallbackTimer.h
include/CallbackTimer.h
+8
-3
CallbackTimer.tcc
include/CallbackTimer.tcc
+3
-3
ORepHelpers.h
include/ORepHelpers.h
+12
-5
ObjectRepository.h
include/ObjectRepository.h
+40
-28
UInterface.h
include/UInterface.h
+17
-17
ModbusClient.h
include/modbus/ModbusClient.h
+35
-29
ModbusClient.cc
src/Communications/Modbus/ModbusClient.cc
+0
-13
UInterface.cc
src/Core/UInterface.cc
+7
-14
ORepHelpers.cc
src/ObjectRepository/ORepHelpers.cc
+8
-14
ObjectRepository.cc
src/ObjectRepository/ObjectRepository.cc
+7
-13
uniset2.includes
uniset2.includes
+1
-1
No files found.
extensions/IOControl/ComediInterface.cc
View file @
cadcafc2
...
...
@@ -43,7 +43,6 @@ ComediInterface::~ComediInterface()
}
// -----------------------------------------------------------------------------
int
ComediInterface
::
getAnalogChannel
(
int
subdev
,
int
channel
,
int
range
,
int
aref
)
const
throw
(
uniset
::
Exception
)
{
lsampl_t
data
=
0
;
int
ret
=
comedi_data_read
(
card
,
subdev
,
channel
,
range
,
aref
,
&
data
);
...
...
@@ -62,7 +61,6 @@ throw(uniset::Exception)
}
// -----------------------------------------------------------------------------
void
ComediInterface
::
setAnalogChannel
(
int
subdev
,
int
channel
,
int
data
,
int
range
,
int
aref
)
const
throw
(
uniset
::
Exception
)
{
if
(
comedi_data_write
(
card
,
subdev
,
channel
,
range
,
aref
,
data
)
<
0
)
{
...
...
@@ -75,7 +73,7 @@ throw(uniset::Exception)
}
}
// -----------------------------------------------------------------------------
bool
ComediInterface
::
getDigitalChannel
(
int
subdev
,
int
channel
)
const
throw
(
uniset
::
Exception
)
bool
ComediInterface
::
getDigitalChannel
(
int
subdev
,
int
channel
)
const
{
lsampl_t
data
=
0
;
...
...
@@ -91,7 +89,6 @@ bool ComediInterface::getDigitalChannel( int subdev, int channel ) const throw(u
}
// -----------------------------------------------------------------------------
void
ComediInterface
::
setDigitalChannel
(
int
subdev
,
int
channel
,
bool
bit
)
const
throw
(
uniset
::
Exception
)
{
if
(
comedi_dio_write
(
card
,
subdev
,
channel
,
bit
)
<
0
)
{
...
...
@@ -104,7 +101,6 @@ throw(uniset::Exception)
// -----------------------------------------------------------------------------
void
ComediInterface
::
configureChannel
(
int
subdev
,
int
channel
,
ChannelType
t
,
int
range
,
int
aref
)
const
throw
(
uniset
::
Exception
)
{
switch
(
t
)
{
...
...
@@ -163,7 +159,6 @@ throw(uniset::Exception)
}
// -----------------------------------------------------------------------------
void
ComediInterface
::
configureSubdev
(
int
subdev
,
SubdevType
type
)
const
throw
(
uniset
::
Exception
)
{
lsampl_t
data
[
2
];
comedi_insn
insn
;
...
...
extensions/IOControl/ComediInterface.h
View file @
cadcafc2
...
...
@@ -31,17 +31,17 @@ namespace uniset
explicit
ComediInterface
(
const
std
::
string
&
dev
,
const
std
::
string
&
cname
);
virtual
~
ComediInterface
();
virtual
int
getAnalogChannel
(
int
subdev
,
int
channel
,
int
range
=
0
,
int
aref
=
AREF_GROUND
)
const
throw
(
uniset
::
Exception
)
;
// throw uniset::Exception
virtual
int
getAnalogChannel
(
int
subdev
,
int
channel
,
int
range
=
0
,
int
aref
=
AREF_GROUND
)
const
;
virtual
void
setAnalogChannel
(
int
subdev
,
int
channel
,
int
data
,
int
range
=
0
,
int
aref
=
AREF_GROUND
)
const
throw
(
uniset
::
Exception
)
;
// throw uniset::Exception
virtual
void
setAnalogChannel
(
int
subdev
,
int
channel
,
int
data
,
int
range
=
0
,
int
aref
=
AREF_GROUND
)
const
;
virtual
bool
getDigitalChannel
(
int
subdev
,
int
channel
)
const
throw
(
uniset
::
Exception
)
;
// throw uniset::Exception
virtual
bool
getDigitalChannel
(
int
subdev
,
int
channel
)
const
;
virtual
void
setDigitalChannel
(
int
subdev
,
int
channel
,
bool
bit
)
const
throw
(
uniset
::
Exception
)
;
// throw uniset::Exception
virtual
void
setDigitalChannel
(
int
subdev
,
int
channel
,
bool
bit
)
const
;
// Конфигурирование входов / выходов
enum
ChannelType
...
...
@@ -64,10 +64,11 @@ namespace uniset
static
std
::
string
type2str
(
SubdevType
t
);
static
SubdevType
str2type
(
const
std
::
string
&
s
);
virtual
void
configureSubdev
(
int
subdev
,
SubdevType
type
)
const
throw
(
uniset
::
Exception
);
// throw uniset::Exception
virtual
void
configureSubdev
(
int
subdev
,
SubdevType
type
)
const
;
virtual
void
configureChannel
(
int
subdev
,
int
channel
,
ChannelType
type
,
int
range
=
0
,
int
aref
=
0
)
const
throw
(
uniset
::
Exception
)
;
// throw uniset::Exception
virtual
void
configureChannel
(
int
subdev
,
int
channel
,
ChannelType
type
,
int
range
=
0
,
int
aref
=
0
)
const
;
inline
const
std
::
string
devname
()
const
{
...
...
@@ -93,4 +94,3 @@ namespace uniset
// -----------------------------------------------------------------------------
#endif // ComediInterface_H_
// -----------------------------------------------------------------------------
extensions/IOControl/tests/FakeIOControl.cc
View file @
cadcafc2
...
...
@@ -97,7 +97,6 @@ namespace uniset
}
// -----------------------------------------------------------------------------
int
FakeComediInterface
::
getAnalogChannel
(
int
subdev
,
int
channel
,
int
range
,
int
aref
)
const
throw
(
uniset
::
Exception
)
{
if
(
channel
<
0
||
channel
>
maxChannelNum
)
{
...
...
@@ -110,7 +109,6 @@ namespace uniset
}
// -----------------------------------------------------------------------------
void
FakeComediInterface
::
setAnalogChannel
(
int
subdev
,
int
channel
,
int
data
,
int
range
,
int
aref
)
const
throw
(
uniset
::
Exception
)
{
if
(
channel
<
0
||
channel
>
maxChannelNum
)
{
...
...
@@ -123,7 +121,6 @@ namespace uniset
}
// -----------------------------------------------------------------------------
bool
FakeComediInterface
::
getDigitalChannel
(
int
subdev
,
int
channel
)
const
throw
(
uniset
::
Exception
)
{
if
(
channel
<
0
||
channel
>
maxChannelNum
)
{
...
...
@@ -136,7 +133,6 @@ namespace uniset
}
// -----------------------------------------------------------------------------
void
FakeComediInterface
::
setDigitalChannel
(
int
subdev
,
int
channel
,
bool
bit
)
const
throw
(
uniset
::
Exception
)
{
if
(
channel
<
0
||
channel
>
maxChannelNum
)
{
...
...
@@ -149,13 +145,11 @@ namespace uniset
}
// -----------------------------------------------------------------------------
void
FakeComediInterface
::
configureSubdev
(
int
subdev
,
ComediInterface
::
SubdevType
type
)
const
throw
(
uniset
::
Exception
)
{
}
// -----------------------------------------------------------------------------
void
FakeComediInterface
::
configureChannel
(
int
subdev
,
int
channel
,
ComediInterface
::
ChannelType
type
,
int
range
,
int
aref
)
const
throw
(
uniset
::
Exception
)
{
}
...
...
extensions/IOControl/tests/FakeIOControl.h
View file @
cadcafc2
...
...
@@ -46,23 +46,17 @@ namespace uniset
// --------------------------------------------
// при тестировании параметры range,aref,subdev игнорируются!
virtual
int
getAnalogChannel
(
int
subdev
,
int
channel
,
int
range
=
0
,
int
aref
=
AREF_GROUND
)
const
throw
(
uniset
::
Exception
)
override
;
virtual
int
getAnalogChannel
(
int
subdev
,
int
channel
,
int
range
=
0
,
int
aref
=
AREF_GROUND
)
const
override
;
virtual
void
setAnalogChannel
(
int
subdev
,
int
channel
,
int
data
,
int
range
=
0
,
int
aref
=
AREF_GROUND
)
const
throw
(
uniset
::
Exception
)
override
;
virtual
void
setAnalogChannel
(
int
subdev
,
int
channel
,
int
data
,
int
range
=
0
,
int
aref
=
AREF_GROUND
)
const
override
;
virtual
bool
getDigitalChannel
(
int
subdev
,
int
channel
)
const
throw
(
uniset
::
Exception
)
override
;
virtual
bool
getDigitalChannel
(
int
subdev
,
int
channel
)
const
override
;
virtual
void
setDigitalChannel
(
int
subdev
,
int
channel
,
bool
bit
)
const
throw
(
uniset
::
Exception
)
override
;
virtual
void
setDigitalChannel
(
int
subdev
,
int
channel
,
bool
bit
)
const
override
;
virtual
void
configureSubdev
(
int
subdev
,
SubdevType
type
)
const
throw
(
uniset
::
Exception
)
override
;
virtual
void
configureSubdev
(
int
subdev
,
SubdevType
type
)
const
override
;
virtual
void
configureChannel
(
int
subdev
,
int
channel
,
ChannelType
type
,
int
range
=
0
,
int
aref
=
0
)
const
throw
(
uniset
::
Exception
)
override
;
virtual
void
configureChannel
(
int
subdev
,
int
channel
,
ChannelType
type
,
int
range
=
0
,
int
aref
=
0
)
const
override
;
};
// --------------------------------------------------------------------------
/*! Специальный IOControl для тестирвания подменяющий все карты в/в на FakeComediInterface */
...
...
extensions/ModbusMaster/RTUStorage.cc
View file @
cadcafc2
...
...
@@ -51,7 +51,7 @@ namespace uniset
}
// -----------------------------------------------------------------------------
void
RTUStorage
::
poll
(
const
std
::
shared_ptr
<
ModbusRTUMaster
>&
mb
)
throw
(
ModbusRTU
::
mbException
)
void
RTUStorage
::
poll
(
const
std
::
shared_ptr
<
ModbusRTUMaster
>&
mb
)
{
try
{
...
...
extensions/ModbusMaster/RTUStorage.h
View file @
cadcafc2
...
...
@@ -34,8 +34,8 @@ namespace uniset
explicit
RTUStorage
(
ModbusRTU
::
ModbusAddr
addr
);
~
RTUStorage
();
void
poll
(
const
std
::
shared_ptr
<
ModbusRTUMaster
>&
mb
)
throw
(
ModbusRTU
::
mbException
);
// throw(ModbusRTU::mbException);
void
poll
(
const
std
::
shared_ptr
<
ModbusRTUMaster
>&
mb
);
inline
ModbusRTU
::
ModbusAddr
getAddress
()
{
...
...
include/CallbackTimer.h
View file @
cadcafc2
...
...
@@ -94,8 +94,13 @@ namespace uniset
timeout_t
getCurrent
(
size_t
id
);
/*!< получить текущее значение таймера */
void
add
(
size_t
id
,
timeout_t
timeMS
)
throw
(
uniset
::
LimitTimers
);
/*!< добавление нового таймера */
void
remove
(
size_t
id
);
/*!< удаление таймера */
/*! добавление нового таймера.
* throw(uniset::LimitTimers)
*/
void
add
(
size_t
id
,
timeout_t
timeMS
);
/*! удаление таймера */
void
remove
(
size_t
id
);
protected
:
...
...
@@ -118,7 +123,7 @@ namespace uniset
struct
TimerInfo
{
TimerInfo
(
size_t
id
,
PassiveTimer
&
pt
)
:
id
(
id
),
pt
(
pt
)
{}
;
id
(
id
),
pt
(
pt
)
{}
size_t
id
;
PassiveTimer
pt
;
...
...
include/CallbackTimer.tcc
View file @
cadcafc2
...
...
@@ -26,14 +26,14 @@
#include "CallbackTimer.h"
// ------------------------------------------------------------------------------------------
template <class Caller> class
CallbackTimer;
//template <class Caller> class uniset::
CallbackTimer;
// ------------------------------------------------------------------------------------------
/*! Создание таймера
\param r - указатель на заказчика
*/
template <class Caller>
CallbackTimer<Caller>::CallbackTimer( Caller* r, Action a ):
CallbackTimer<Caller>::CallbackTimer( Caller* r,
CallbackTimer<Caller>::
Action a ):
cal(r),
act(a),
terminated(false)
...
...
@@ -102,7 +102,7 @@ void CallbackTimer<Caller>::terminate()
// ------------------------------------------------------------------------------------------
template <class Caller>
void CallbackTimer<Caller>::add(size_t id, timeout_t timeMS )
throw(uniset::LimitTimers)
void CallbackTimer<Caller>::add(size_t id, timeout_t timeMS )
{
if( lst.size() >= MAXCallbackTimer )
{
...
...
include/ORepHelpers.h
View file @
cadcafc2
...
...
@@ -37,14 +37,21 @@ namespace uniset
//! Получение ссылки на корень репозитория
CosNaming
::
NamingContext_ptr
getRootNamingContext
(
const
CORBA
::
ORB_ptr
orb
,
const
std
::
string
&
nsName
);
//! Получение контекста по заданному имени
/*!
* Получение контекста по заданному имени
* \param cname - полное имя контекста ссылку на который, возвратит функция.
* \param argc - argc
* \param argc - argv
* \param nsName - параметры инициализации ORB
*
* throw uniset::ORepFailed
*/
CosNaming
::
NamingContext_ptr
getContext
(
const
std
::
string
&
cname
,
int
argc
,
const
char
*
const
*
argv
,
const
std
::
string
&
nsName
)
throw
(
uniset
::
ORepFailed
);
const
char
*
const
*
argv
,
const
std
::
string
&
nsName
);
// throw uniset::ORepFailed
CosNaming
::
NamingContext_ptr
getContext
(
const
CORBA
::
ORB_ptr
orb
,
const
std
::
string
&
cname
,
const
std
::
string
&
nsName
)
throw
(
uniset
::
ORepFailed
);
const
std
::
string
&
nsName
);
//! Функция отделяющая имя секции от полного имени
const
std
::
string
getSectionName
(
const
std
::
string
&
fullName
,
const
std
::
string
&
brk
=
"/"
);
...
...
include/ObjectRepository.h
View file @
cadcafc2
...
...
@@ -52,26 +52,32 @@ namespace uniset
/**
@defgroup ORepGroup Группа функций регистрации в репозитории объектов
@{ */
//! Функция регистрации объекта по имени с указанием секции
void
registration
(
const
std
::
string
&
name
,
const
uniset
::
ObjectPtr
oRef
,
const
std
::
string
&
section
,
bool
force
=
false
)
const
throw
(
uniset
::
ORepFailed
,
uniset
::
ObjectNameAlready
,
uniset
::
InvalidObjectName
,
uniset
::
NameNotFound
);
//! Функция регистрации объекта по полному имени.
void
registration
(
const
std
::
string
&
fullName
,
const
uniset
::
ObjectPtr
oRef
,
bool
force
=
false
)
const
throw
(
uniset
::
ORepFailed
,
uniset
::
ObjectNameAlready
,
uniset
::
InvalidObjectName
,
uniset
::
NameNotFound
);
//! Удаление записи об объекте name в секции section
void
unregistration
(
const
std
::
string
&
name
,
const
std
::
string
&
section
)
const
throw
(
uniset
::
ORepFailed
,
uniset
::
NameNotFound
);
//! Удаление записи об объекте по полному имени
void
unregistration
(
const
std
::
string
&
fullName
)
const
throw
(
uniset
::
ORepFailed
,
uniset
::
NameNotFound
);
/*! Функция регистрации объекта по имени с указанием секции
* throw(uniset::ORepFailed, uniset::ObjectNameAlready, uniset::InvalidObjectName, uniset::NameNotFound);
*/
void
registration
(
const
std
::
string
&
name
,
const
uniset
::
ObjectPtr
oRef
,
const
std
::
string
&
section
,
bool
force
=
false
)
const
;
/*! Функция регистрации объекта по полному имени.
* throw(uniset::ORepFailed, uniset::ObjectNameAlready, uniset::InvalidObjectName, uniset::NameNotFound);
*/
void
registration
(
const
std
::
string
&
fullName
,
const
uniset
::
ObjectPtr
oRef
,
bool
force
=
false
)
const
;
/*! Удаление записи об объекте name в секции section
* throw(uniset::ORepFailed, uniset::NameNotFound);
*/
void
unregistration
(
const
std
::
string
&
name
,
const
std
::
string
&
section
)
const
;
/*! Удаление записи об объекте по полному имени
* throw(uniset::ORepFailed, uniset::NameNotFound);
*/
void
unregistration
(
const
std
::
string
&
fullName
)
const
;
// @}
// end of ORepGroup
/*! Получение ссылки по заданному полному имени (разыменовывание) */
uniset
::
ObjectPtr
resolve
(
const
std
::
string
&
name
,
const
std
::
string
&
NSName
=
"NameService"
)
const
throw
(
uniset
::
ORepFailed
,
uniset
::
NameNotFound
);
/*! Получение ссылки по заданному полному имени (разыменовывание)
* throw(uniset::ORepFailed, uniset::NameNotFound);
*/
uniset
::
ObjectPtr
resolve
(
const
std
::
string
&
name
,
const
std
::
string
&
NSName
=
"NameService"
)
const
;
/*! Проверка существования и доступности объекта */
bool
isExist
(
const
uniset
::
ObjectPtr
&
oref
)
const
;
...
...
@@ -90,20 +96,26 @@ namespace uniset
Section
/*!< подсекция */
};
//! Получение списка how_many объектов из секции section.
bool
list
(
const
std
::
string
&
section
,
uniset
::
ListObjectName
*
ls
,
size_t
how_many
=
300
)
const
throw
(
uniset
::
ORepFailed
);
/*! Получение списка how_many объектов из секции section.
* throw(uniset::ORepFailed)
*/
bool
list
(
const
std
::
string
&
section
,
uniset
::
ListObjectName
*
ls
,
size_t
how_many
=
300
)
const
;
//! Получние списка how_many подсекций из секции in_section.
bool
listSections
(
const
std
::
string
&
in_section
,
uniset
::
ListObjectName
*
ls
,
size_t
how_many
=
300
)
const
throw
(
uniset
::
ORepFailed
);
/*! Получние списка how_many подсекций из секции in_section.
* throw(uniset::ORepFailed);
*/
bool
listSections
(
const
std
::
string
&
in_section
,
uniset
::
ListObjectName
*
ls
,
size_t
how_many
=
300
)
const
;
// -------------------------------------------------------------------
//! Создание секции
bool
createSection
(
const
std
::
string
&
name
,
const
std
::
string
&
in_section
)
const
throw
(
uniset
::
ORepFailed
,
uniset
::
InvalidObjectName
);
/*! Создание секции по полному имени */
bool
createSectionF
(
const
std
::
string
&
fullName
)
const
throw
(
uniset
::
ORepFailed
,
uniset
::
InvalidObjectName
);
/*! Создание секции
* throw(uniset::ORepFailed, uniset::InvalidObjectName);
*/
bool
createSection
(
const
std
::
string
&
name
,
const
std
::
string
&
in_section
)
const
;
/*! Создание секции по полному имени
* throw(uniset::ORepFailed, uniset::InvalidObjectName);
*/
bool
createSectionF
(
const
std
::
string
&
fullName
)
const
;
//! Функция создания секции в корневом 'каталоге'
bool
createRootSection
(
const
std
::
string
&
name
)
const
;
...
...
include/UInterface.h
View file @
cadcafc2
...
...
@@ -36,9 +36,6 @@
#include "IOController_i.hh"
#include "MessageType.h"
#include "Configuration.h"
// -----------------------------------------------------------------------------------------
#define UI_THROW_EXCEPTIONS uniset::TimeOut,uniset::IOBadParam,uniset::ORepFailed,uniset::SystemError
// -----------------------------------------------------------------------------------------
namespace
uniset
{
...
...
@@ -64,12 +61,12 @@ namespace uniset
// Работа с датчиками
//! Получение состояния датчика
long
getValue
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
throw
(
UI_THROW_EXCEPTIONS
)
;
long
getValue
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
;
long
getValue
(
const
uniset
::
ObjectId
id
)
const
;
long
getRawValue
(
const
IOController_i
::
SensorInfo
&
si
);
//! Выставление состояния датчика
void
setValue
(
const
uniset
::
ObjectId
id
,
long
value
,
const
uniset
::
ObjectId
node
,
uniset
::
ObjectId
sup_id
=
uniset
::
DefaultObjectId
)
const
throw
(
UI_THROW_EXCEPTIONS
)
;
void
setValue
(
const
uniset
::
ObjectId
id
,
long
value
,
const
uniset
::
ObjectId
node
,
uniset
::
ObjectId
sup_id
=
uniset
::
DefaultObjectId
)
const
;
void
setValue
(
const
uniset
::
ObjectId
id
,
long
value
)
const
;
void
setValue
(
const
IOController_i
::
SensorInfo
&
si
,
long
value
,
const
uniset
::
ObjectId
supplier
)
const
;
...
...
@@ -92,7 +89,7 @@ namespace uniset
uniset
::
ObjectId
backid
=
uniset
::
DefaultObjectId
)
const
;
void
askRemoteSensor
(
const
uniset
::
ObjectId
id
,
UniversalIO
::
UIOCommand
cmd
,
const
uniset
::
ObjectId
node
,
uniset
::
ObjectId
backid
=
uniset
::
DefaultObjectId
)
const
throw
(
UI_THROW_EXCEPTIONS
)
;
uniset
::
ObjectId
backid
=
uniset
::
DefaultObjectId
)
const
;
//! Заказ по списку
uniset
::
IDSeq_var
askSensorsSeq
(
const
uniset
::
IDList
&
lst
,
UniversalIO
::
UIOCommand
cmd
,
...
...
@@ -129,14 +126,14 @@ namespace uniset
// ---------------------------------------------------------------
// Вспомогательные функции
UniversalIO
::
IOType
getIOType
(
const
uniset
::
ObjectId
id
,
uniset
::
ObjectId
node
)
const
throw
(
UI_THROW_EXCEPTIONS
)
;
UniversalIO
::
IOType
getIOType
(
const
uniset
::
ObjectId
id
,
uniset
::
ObjectId
node
)
const
;
UniversalIO
::
IOType
getIOType
(
const
uniset
::
ObjectId
id
)
const
;
// read from xml (only for xml!) т.е. без удалённого запроса
UniversalIO
::
IOType
getConfIOType
(
const
uniset
::
ObjectId
id
)
const
noexcept
;
// Получение типа объекта..
uniset
::
ObjectType
getType
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
throw
(
UI_THROW_EXCEPTIONS
)
;
uniset
::
ObjectType
getType
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
;
uniset
::
ObjectType
getType
(
const
uniset
::
ObjectId
id
)
const
;
//! Время последнего изменения датчика
...
...
@@ -158,11 +155,13 @@ namespace uniset
// ---------------------------------------------------------------
// Работа с репозиторием
// /*! регистрация объекта в репозитории */
void
registered
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectPtr
oRef
,
bool
force
=
false
)
const
throw
(
uniset
::
ORepFailed
);
/*! регистрация объекта в репозитории
* throw(uniset::ORepFailed)
*/
void
registered
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectPtr
oRef
,
bool
force
=
false
)
const
;
//
/*! разрегистрация объекта */
void
unregister
(
const
uniset
::
ObjectId
id
)
throw
(
uniset
::
ORepFailed
)
;
//
throw(uniset::ORepFailed)
void
unregister
(
const
uniset
::
ObjectId
id
);
/*! получение ссылки на объект */
inline
uniset
::
ObjectPtr
resolve
(
const
std
::
string
&
name
)
const
...
...
@@ -175,9 +174,8 @@ namespace uniset
return
rep
.
resolve
(
oind
->
getNameById
(
id
)
);
}
uniset
::
ObjectPtr
resolve
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
nodeName
)
const
throw
(
uniset
::
ResolveNameError
,
uniset
::
TimeOut
);
// throw(uniset::ResolveNameError, uniset::TimeOut);
uniset
::
ObjectPtr
resolve
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
nodeName
)
const
;
// Проверка доступности объекта или датчика
bool
isExist
(
const
uniset
::
ObjectId
id
)
const
noexcept
;
...
...
@@ -233,7 +231,7 @@ namespace uniset
// Посылка сообщений
/*! посылка сообщения msg объекту name на узел node */
void
send
(
const
uniset
::
ObjectId
name
,
const
uniset
::
TransportMessage
&
msg
,
uniset
::
ObjectId
node
)
throw
(
UI_THROW_EXCEPTIONS
)
;
void
send
(
const
uniset
::
ObjectId
name
,
const
uniset
::
TransportMessage
&
msg
,
uniset
::
ObjectId
node
);
void
send
(
const
uniset
::
ObjectId
name
,
const
uniset
::
TransportMessage
&
msg
);
// ---------------------------------------------------------------
...
...
@@ -252,7 +250,9 @@ namespace uniset
MaxSize
(
maxsize
),
minCallCount
(
cleancount
)
{};
~
CacheOfResolve
()
{};
uniset
::
ObjectPtr
resolve
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
throw
(
uniset
::
NameNotFound
,
uniset
::
SystemError
);
// throw(uniset::NameNotFound, uniset::SystemError)
uniset
::
ObjectPtr
resolve
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
;
void
cache
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
,
uniset
::
ObjectVar
&
ptr
)
const
;
void
erase
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
noexcept
;
...
...
include/modbus/ModbusClient.h
View file @
cadcafc2
...
...
@@ -27,78 +27,81 @@ namespace uniset
\param addr - адрес slave-узла
\param start - начальный регистр с которого читать
\param count - сколько регистров читать
throw ModbusRTU::mbException
*/
ModbusRTU
::
ReadCoilRetMessage
read01
(
ModbusRTU
::
ModbusAddr
addr
,
ModbusRTU
::
ModbusData
start
,
ModbusRTU
::
ModbusData
count
)
throw
(
ModbusRTU
::
mbException
);
ModbusRTU
::
ModbusData
start
,
ModbusRTU
::
ModbusData
count
);
/*! Чтение группы регистров (0x02)
\param addr - адрес slave-узла
\param start - начальный регистр с которого читать
\param count - сколько регистров читать
throw ModbusRTU::mbException
*/
ModbusRTU
::
ReadInputStatusRetMessage
read02
(
ModbusRTU
::
ModbusAddr
addr
,
ModbusRTU
::
ModbusData
start
,
ModbusRTU
::
ModbusData
count
)
throw
(
ModbusRTU
::
mbException
);
ModbusRTU
::
ModbusData
start
,
ModbusRTU
::
ModbusData
count
);
/*! Чтение группы регистров (0x03)
\param addr - адрес slave-узла
\param start - начальный регистр с которого читать
\param count - сколько регистров читать
throw ModbusRTU::mbException
*/
ModbusRTU
::
ReadOutputRetMessage
read03
(
ModbusRTU
::
ModbusAddr
addr
,
ModbusRTU
::
ModbusData
start
,
ModbusRTU
::
ModbusData
count
)
throw
(
ModbusRTU
::
mbException
);
ModbusRTU
::
ModbusData
start
,
ModbusRTU
::
ModbusData
count
);
/*! Чтение группы регистров (0x04)
\param addr - адрес slave-узла
\param start - начальный регистр с которого читать
\param count - сколько регистров читать
throw ModbusRTU::mbException
*/
ModbusRTU
::
ReadInputRetMessage
read04
(
ModbusRTU
::
ModbusAddr
addr
,
ModbusRTU
::
ModbusData
start
,
ModbusRTU
::
ModbusData
count
)
throw
(
ModbusRTU
::
mbException
);
ModbusRTU
::
ModbusData
start
,
ModbusRTU
::
ModbusData
count
);
/*! 0x05
\param addr - адрес slave-узла
\param reg - записываемый регистр
\param cmd - команда ON | OFF
throw ModbusRTU::mbException
*/
ModbusRTU
::
ForceSingleCoilRetMessage
write05
(
ModbusRTU
::
ModbusAddr
addr
,
ModbusRTU
::
ModbusData
reg
,
bool
cmd
)
throw
(
ModbusRTU
::
mbException
);
ModbusRTU
::
ModbusData
reg
,
bool
cmd
);
/*! Запись одного регистра (0x06)
\param addr - адрес slave-узла
\param reg - записываемый регистр
\param data - данные
throw ModbusRTU::mbException
*/
ModbusRTU
::
WriteSingleOutputRetMessage
write06
(
ModbusRTU
::
ModbusAddr
addr
,
ModbusRTU
::
ModbusData
reg
,
ModbusRTU
::
ModbusData
data
)
throw
(
ModbusRTU
::
mbException
);
ModbusRTU
::
ModbusData
reg
,
ModbusRTU
::
ModbusData
data
);
/*! Запись группы выходов (0x0F) */
ModbusRTU
::
ForceCoilsRetMessage
write0F
(
ModbusRTU
::
ForceCoilsMessage
&
msg
)
throw
(
ModbusRTU
::
mbException
);
/*! Запись группы выходов (0x0F) throw ModbusRTU::mbException*/
ModbusRTU
::
ForceCoilsRetMessage
write0F
(
ModbusRTU
::
ForceCoilsMessage
&
msg
);
/*! Запись группы регистров (0x10) */
ModbusRTU
::
WriteOutputRetMessage
write10
(
ModbusRTU
::
WriteOutputMessage
&
msg
)
throw
(
ModbusRTU
::
mbException
);
/*! Запись группы регистров (0x10) throw ModbusRTU::mbException*/
ModbusRTU
::
WriteOutputRetMessage
write10
(
ModbusRTU
::
WriteOutputMessage
&
msg
);
/*! Диагностика (0x08) */
/*! Диагностика (0x08)
throw ModbusRTU::mbException
*/
ModbusRTU
::
DiagnosticRetMessage
diag08
(
ModbusRTU
::
ModbusAddr
addr
,
ModbusRTU
::
DiagnosticsSubFunction
subfunc
,
ModbusRTU
::
ModbusData
dat
=
0
)
throw
(
ModbusRTU
::
mbException
);
ModbusRTU
::
ModbusData
dat
=
0
);
/*! Modbus Encapsulated Interface 43(0x2B)
Read Device Identification 14(0x0E)
throw ModbusRTU::mbException
*/
ModbusRTU
::
MEIMessageRetRDI
read4314
(
ModbusRTU
::
ModbusAddr
addr
,
ModbusRTU
::
ModbusByte
devID
,
ModbusRTU
::
ModbusByte
objID
)
throw
(
ModbusRTU
::
mbException
);
ModbusRTU
::
ModbusByte
objID
);
/*! Установить системное время (0x50)
hour - часы [0..23]
...
...
@@ -108,12 +111,13 @@ namespace uniset
mon - месяц [1..12]
year - год [0..99]
century - столетие [19-20]
throw ModbusRTU::mbException
*/
ModbusRTU
::
SetDateTimeRetMessage
setDateTime
(
ModbusRTU
::
ModbusAddr
addr
,
ModbusRTU
::
ModbusByte
hour
,
ModbusRTU
::
ModbusByte
min
,
ModbusRTU
::
ModbusByte
sec
,
ModbusRTU
::
ModbusByte
day
,
ModbusRTU
::
ModbusByte
mon
,
ModbusRTU
::
ModbusByte
year
,
ModbusRTU
::
ModbusByte
century
)
throw
(
ModbusRTU
::
mbException
);
ModbusRTU
::
ModbusByte
century
);
/*! Загрузить файл (0x66)
...
...
@@ -121,19 +125,21 @@ namespace uniset
\param numpack - номер очередного запрашиваемого пакета
\param save2filename - имя файла, под которым будет сохранён полученный файл
\param part_timeout_msec - таймаут на получение очередной части файла.
throw ModbusRTU::mbException
*/
ModbusRTU
::
FileTransferRetMessage
partOfFileTransfer
(
ModbusRTU
::
ModbusAddr
addr
,
ModbusRTU
::
ModbusData
idFile
,
ModbusRTU
::
ModbusData
numpack
,
timeout_t
part_timeout_msec
=
2000
)
throw
(
ModbusRTU
::
mbException
);
ModbusRTU
::
ModbusData
numpack
,
timeout_t
part_timeout_msec
=
2000
);
/*! Загрузить файл
\param idFile - идентификатор файла
\param save2filename - имя файла, под которым будет сохранён полученный файл
\param part_timeout_msec - таймаут на получение очередной части файла.
throw ModbusRTU::mbException
*/
void
fileTransfer
(
ModbusRTU
::
ModbusAddr
addr
,
ModbusRTU
::
ModbusData
idFile
,
const
std
::
string
&
save2filename
,
timeout_t
part_timeout_msec
=
2000
)
throw
(
ModbusRTU
::
mbException
);
const
std
::
string
&
save2filename
,
timeout_t
part_timeout_msec
=
2000
);
// ---------------------------------------------------------------------
/*! установить время ожидания по умолчанию */
...
...
src/Communications/Modbus/ModbusClient.cc
View file @
cadcafc2
...
...
@@ -59,7 +59,6 @@ namespace uniset
// --------------------------------------------------------------------------------
ReadCoilRetMessage
ModbusClient
::
read01
(
ModbusAddr
addr
,
ModbusData
start
,
ModbusData
count
)
throw
(
ModbusRTU
::
mbException
)
{
ReadCoilMessage
msg
(
addr
,
start
,
count
);
qbuf
=
msg
.
transport_msg
();
...
...
@@ -80,7 +79,6 @@ namespace uniset
// --------------------------------------------------------------------------------
ReadInputStatusRetMessage
ModbusClient
::
read02
(
ModbusAddr
addr
,
ModbusData
start
,
ModbusData
count
)
throw
(
ModbusRTU
::
mbException
)
{
ReadInputStatusMessage
msg
(
addr
,
start
,
count
);
qbuf
=
msg
.
transport_msg
();
...
...
@@ -102,7 +100,6 @@ namespace uniset
// --------------------------------------------------------------------------------
ReadOutputRetMessage
ModbusClient
::
read03
(
ModbusAddr
addr
,
ModbusData
start
,
ModbusData
count
)
throw
(
ModbusRTU
::
mbException
)
{
ReadOutputMessage
msg
(
addr
,
start
,
count
);
qbuf
=
msg
.
transport_msg
();
...
...
@@ -124,7 +121,6 @@ namespace uniset
// --------------------------------------------------------------------------------
ReadInputRetMessage
ModbusClient
::
read04
(
ModbusAddr
addr
,
ModbusData
start
,
ModbusData
count
)
throw
(
ModbusRTU
::
mbException
)
{
ReadInputMessage
msg
(
addr
,
start
,
count
);
qbuf
=
msg
.
transport_msg
();
...
...
@@ -145,7 +141,6 @@ namespace uniset
// --------------------------------------------------------------------------------
ForceSingleCoilRetMessage
ModbusClient
::
write05
(
ModbusAddr
addr
,
ModbusData
start
,
bool
cmd
)
throw
(
ModbusRTU
::
mbException
)
{
ForceSingleCoilMessage
msg
(
addr
,
start
,
cmd
);
qbuf
=
msg
.
transport_msg
();
...
...
@@ -171,7 +166,6 @@ namespace uniset
WriteSingleOutputRetMessage
ModbusClient
::
write06
(
ModbusAddr
addr
,
ModbusData
start
,
ModbusData
data
)
throw
(
ModbusRTU
::
mbException
)
{
WriteSingleOutputMessage
msg
(
addr
,
start
,
data
);
qbuf
=
msg
.
transport_msg
();
...
...
@@ -195,7 +189,6 @@ namespace uniset
}
// --------------------------------------------------------------------------------
ForceCoilsRetMessage
ModbusClient
::
write0F
(
ForceCoilsMessage
&
msg
)
throw
(
ModbusRTU
::
mbException
)
{
qbuf
=
msg
.
transport_msg
();
mbErrCode
res
=
query
(
msg
.
addr
,
qbuf
,
qreply
,
replyTimeOut_ms
);
...
...
@@ -218,7 +211,6 @@ namespace uniset
// --------------------------------------------------------------------------------
WriteOutputRetMessage
ModbusClient
::
write10
(
WriteOutputMessage
&
msg
)
throw
(
ModbusRTU
::
mbException
)
{
qbuf
=
msg
.
transport_msg
();
mbErrCode
res
=
query
(
msg
.
addr
,
qbuf
,
qreply
,
replyTimeOut_ms
);
...
...
@@ -242,7 +234,6 @@ namespace uniset
DiagnosticRetMessage
ModbusClient
::
diag08
(
ModbusAddr
addr
,
DiagnosticsSubFunction
subfunc
,
ModbusRTU
::
ModbusData
dat
)
throw
(
ModbusRTU
::
mbException
)
{
DiagnosticMessage
msg
(
addr
,
subfunc
,
dat
);
qbuf
=
msg
.
transport_msg
();
...
...
@@ -264,7 +255,6 @@ namespace uniset
ModbusRTU
::
MEIMessageRetRDI
ModbusClient
::
read4314
(
ModbusRTU
::
ModbusAddr
addr
,
ModbusRTU
::
ModbusByte
devID
,
ModbusRTU
::
ModbusByte
objID
)
throw
(
ModbusRTU
::
mbException
)
{
MEIMessageRDI
msg
(
addr
,
devID
,
objID
);
qbuf
=
msg
.
transport_msg
();
...
...
@@ -289,7 +279,6 @@ namespace uniset
SetDateTimeRetMessage
ModbusClient
::
setDateTime
(
ModbusAddr
addr
,
ModbusByte
hour
,
ModbusByte
min
,
ModbusByte
sec
,
ModbusByte
day
,
ModbusByte
mon
,
ModbusByte
year
,
ModbusByte
century
)
throw
(
ModbusRTU
::
mbException
)
{
SetDateTimeMessage
msg
(
addr
);
msg
.
hour
=
hour
;
...
...
@@ -311,7 +300,6 @@ namespace uniset
// --------------------------------------------------------------------------------
void
ModbusClient
::
fileTransfer
(
ModbusAddr
addr
,
ModbusData
numfile
,
const
std
::
string
&
save2filename
,
timeout_t
part_timeout_msec
)
throw
(
ModbusRTU
::
mbException
)
{
//#warning Необходимо реализовать
// throw mbException(erUnExpectedPacketType);
...
...
@@ -403,7 +391,6 @@ namespace uniset
FileTransferRetMessage
ModbusClient
::
partOfFileTransfer
(
ModbusAddr
addr
,
ModbusData
idFile
,
ModbusData
numpack
,
timeout_t
part_timeout_msec
)
throw
(
ModbusRTU
::
mbException
)
{
FileTransferMessage
msg
(
addr
,
idFile
,
numpack
);
qbuf
=
msg
.
transport_msg
();
...
...
src/Core/UInterface.cc
View file @
cadcafc2
...
...
@@ -115,7 +115,6 @@ namespace uniset
* \exception IOTimeOut - генерируется если в течение времени timeout небыл получен ответ
*/
long
UInterface
::
getValue
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
throw
(
UI_THROW_EXCEPTIONS
)
{
if
(
id
==
uniset
::
DefaultObjectId
)
throw
uniset
::
ORepFailed
(
"UI(getValue): error id=uniset::DefaultObjectId"
);
...
...
@@ -285,7 +284,6 @@ namespace uniset
* \exception IOBadParam - генерируется если указано неправильное имя вывода или секции
*/
void
UInterface
::
setValue
(
const
uniset
::
ObjectId
id
,
long
value
,
const
uniset
::
ObjectId
node
,
const
uniset
::
ObjectId
sup_id
)
const
throw
(
UI_THROW_EXCEPTIONS
)
{
if
(
id
==
uniset
::
DefaultObjectId
)
throw
uniset
::
ORepFailed
(
"UI(setValue): error: id=uniset::DefaultObjectId"
);
...
...
@@ -478,7 +476,7 @@ namespace uniset
*/
void
UInterface
::
askRemoteSensor
(
const
uniset
::
ObjectId
id
,
UniversalIO
::
UIOCommand
cmd
,
const
uniset
::
ObjectId
node
,
uniset
::
ObjectId
backid
)
const
throw
(
UI_THROW_EXCEPTIONS
)
uniset
::
ObjectId
backid
)
const
{
if
(
backid
==
uniset
::
DefaultObjectId
)
backid
=
myid
;
...
...
@@ -581,7 +579,6 @@ namespace uniset
* \param node - идентификатор узла
*/
IOType
UInterface
::
getIOType
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
throw
(
UI_THROW_EXCEPTIONS
)
{
if
(
id
==
uniset
::
DefaultObjectId
)
throw
uniset
::
ORepFailed
(
"UI(getIOType): error: id=uniset::DefaultObjectId"
);
...
...
@@ -672,7 +669,6 @@ namespace uniset
* \param node - идентификатор узла
*/
uniset
::
ObjectType
UInterface
::
getType
(
const
uniset
::
ObjectId
name
,
const
uniset
::
ObjectId
node
)
const
throw
(
UI_THROW_EXCEPTIONS
)
{
if
(
name
==
uniset
::
DefaultObjectId
)
throw
uniset
::
ORepFailed
(
"UI(getType): попытка обратиться к объекту с id=uniset::DefaultObjectId"
);
...
...
@@ -760,7 +756,7 @@ namespace uniset
}
// ------------------------------------------------------------------------------------------------------------
void
UInterface
::
registered
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectPtr
oRef
,
bool
force
)
const
throw
(
uniset
::
ORepFailed
)
void
UInterface
::
registered
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectPtr
oRef
,
bool
force
)
const
{
// если влючён режим использования локальных файлов
// то пишем IOR в файл
...
...
@@ -784,7 +780,7 @@ namespace uniset
}
// ------------------------------------------------------------------------------------------------------------
void
UInterface
::
unregister
(
const
uniset
::
ObjectId
id
)
throw
(
uniset
::
ORepFailed
)
void
UInterface
::
unregister
(
const
uniset
::
ObjectId
id
)
{
if
(
uconf
->
isLocalIOR
()
)
{
...
...
@@ -804,7 +800,6 @@ namespace uniset
// ------------------------------------------------------------------------------------------------------------
uniset
::
ObjectPtr
UInterface
::
resolve
(
const
uniset
::
ObjectId
rid
,
const
uniset
::
ObjectId
node
)
const
throw
(
uniset
::
ResolveNameError
,
uniset
::
TimeOut
)
{
if
(
rid
==
uniset
::
DefaultObjectId
)
throw
uniset
::
ResolveNameError
(
"UI(resolve): ID=uniset::DefaultObjectId"
);
...
...
@@ -950,7 +945,6 @@ namespace uniset
// -------------------------------------------------------------------------------------------
void
UInterface
::
send
(
const
uniset
::
ObjectId
name
,
const
uniset
::
TransportMessage
&
msg
,
const
uniset
::
ObjectId
node
)
throw
(
UI_THROW_EXCEPTIONS
)
{
if
(
name
==
uniset
::
DefaultObjectId
)
throw
uniset
::
ORepFailed
(
"UI(send): ERROR: id=uniset::DefaultObjectId"
);
...
...
@@ -985,7 +979,7 @@ namespace uniset
}
catch
(
const
CORBA
::
TRANSIENT
&
)
{}
catch
(
const
CORBA
::
OBJECT_NOT_EXIST
&
)
{}
catch
(
const
CORBA
::
SystemException
&
ex
)
{}
catch
(
const
CORBA
::
SystemException
&
)
{}
msleep
(
uconf
->
getRepeatTimeout
());
oref
=
CORBA
::
Object
::
_nil
();
...
...
@@ -1006,12 +1000,12 @@ namespace uniset
rcache
.
erase
(
name
,
node
);
throw
uniset
::
IOBadParam
(
set_err
(
"UI(send): object not exist"
,
name
,
node
));
}
catch
(
const
CORBA
::
COMM_FAILURE
&
ex
)
catch
(
const
CORBA
::
COMM_FAILURE
&
)
{
// ошибка системы коммуникации
// uwarn << "UI(send): ошибка системы коммуникации" << endl;
}
catch
(
const
CORBA
::
SystemException
&
ex
)
catch
(
const
CORBA
::
SystemException
&
)
{
// ошибка системы коммуникации
// uwarn << "UI(send): CORBA::SystemException" << endl;
...
...
@@ -1061,7 +1055,7 @@ namespace uniset
}
catch
(
const
CORBA
::
TRANSIENT
&
)
{}
catch
(
const
CORBA
::
OBJECT_NOT_EXIST
&
)
{}
catch
(
const
CORBA
::
SystemException
&
ex
)
{}
catch
(
const
CORBA
::
SystemException
&
)
{}
msleep
(
uconf
->
getRepeatTimeout
());
oref
=
CORBA
::
Object
::
_nil
();
...
...
@@ -1265,7 +1259,6 @@ namespace uniset
}
// ------------------------------------------------------------------------------------------------------------
uniset
::
ObjectPtr
UInterface
::
CacheOfResolve
::
resolve
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
throw
(
uniset
::
NameNotFound
,
uniset
::
SystemError
)
{
try
{
...
...
src/ObjectRepository/ORepHelpers.cc
View file @
cadcafc2
...
...
@@ -36,20 +36,14 @@ namespace uniset
// --------------------------------------------------------------------------
/*!
* \param cname - полное имя контекста ссылку на который, возвратит функция.
* \param argc - argc
* \param argc - argv
* \param nsName - параметры инициализации ORB
*/
CosNaming
::
NamingContext_ptr
getContext
(
const
string
&
cname
,
int
argc
,
const
char
*
const
*
argv
,
const
string
&
nsName
)
throw
(
ORepFailed
)
CosNaming
::
NamingContext_ptr
getContext
(
const
string
&
cname
,
int
argc
,
const
char
*
const
*
argv
,
const
string
&
nsName
)
{
CORBA
::
ORB_var
orb
=
CORBA
::
ORB_init
(
argc
,
(
char
**
)
argv
);
CORBA
::
ORB_var
orb
=
CORBA
::
ORB_init
(
argc
,
const_cast
<
char
**>
(
argv
)
);
ulogrep
<<
"OREPHELP: orb init ok"
<<
endl
;
return
getContext
(
orb
,
cname
,
nsName
);
}
// --------------------------------------------------------------------------
CosNaming
::
NamingContext_ptr
getContext
(
const
CORBA
::
ORB_ptr
orb
,
const
string
&
cname
,
const
string
&
servname
)
throw
(
ORepFailed
)
CosNaming
::
NamingContext_ptr
getContext
(
const
CORBA
::
ORB_ptr
orb
,
const
string
&
cname
,
const
string
&
servname
)
{
CosNaming
::
NamingContext_var
rootC
;
...
...
@@ -84,14 +78,14 @@ namespace uniset
throw
ORepFailed
(
err
.
c_str
());
}
}
catch
(
const
CosNaming
::
NamingContext
::
InvalidName
&
nf
)
catch
(
const
CosNaming
::
NamingContext
::
InvalidName
&
)
{
ostringstream
err
;
err
<<
"OREPHELPER(getContext): не смог получить ссылку на контекст "
<<
cname
;
uwarn
<<
err
.
str
()
<<
endl
;
throw
ORepFailed
(
err
.
str
());
}
catch
(
const
CosNaming
::
NamingContext
::
NotFound
&
nf
)
catch
(
const
CosNaming
::
NamingContext
::
NotFound
&
)
{
ostringstream
err
;
err
<<
"OREPHELPER(getContext): не найден контекст "
<<
cname
;
...
...
@@ -163,20 +157,20 @@ namespace uniset
ulogrep
<<
"OREPHELP: init NameService ok"
<<
endl
;
}
catch
(
const
CORBA
::
ORB
::
InvalidName
&
ex
)
catch
(
const
CORBA
::
ORB
::
InvalidName
&
)
{
ostringstream
err
;
err
<<
"ORepHelpers(getRootNamingContext): InvalidName="
<<
nsName
;
uwarn
<<
err
.
str
()
<<
endl
;
throw
ORepFailed
(
err
.
str
());
}
catch
(
const
CORBA
::
COMM_FAILURE
&
ex
)
catch
(
const
CORBA
::
COMM_FAILURE
&
)
{
ostringstream
err
;
err
<<
"ORepHelpers(getRootNamingContext): Не смог получить ссылку на контекст ->"
<<
nsName
;
throw
ORepFailed
(
err
.
str
());
}
catch
(
const
omniORB
::
fatalException
&
ex
)
catch
(
const
omniORB
::
fatalException
&
)
{
string
err
(
"ORepHelpers(getRootNamingContext): Caught Fatal Exception"
);
throw
ORepFailed
(
err
);
...
...
src/ObjectRepository/ObjectRepository.cc
View file @
cadcafc2
...
...
@@ -84,7 +84,6 @@ bool ObjectRepository::init() const
* \sa registration(const std::string& fullName, const CORBA::Object_ptr oRef)
*/
void
ObjectRepository
::
registration
(
const
string
&
name
,
const
ObjectPtr
oRef
,
const
string
&
section
,
bool
force
)
const
throw
(
ORepFailed
,
ObjectNameAlready
,
InvalidObjectName
,
NameNotFound
)
{
ostringstream
err
;
...
...
@@ -183,7 +182,6 @@ throw(ORepFailed, ObjectNameAlready, InvalidObjectName, NameNotFound)
* \sa registration(const string name, const ObjectPtr oRef, const string section)
*/
void
ObjectRepository
::
registration
(
const
std
::
string
&
fullName
,
const
uniset
::
ObjectPtr
oRef
,
bool
force
)
const
throw
(
ORepFailed
,
ObjectNameAlready
,
InvalidObjectName
,
NameNotFound
)
{
// string n(ORepHelpers::getShortName(fullName));
string
n
(
uconf
->
oind
->
getBaseName
(
fullName
)
);
...
...
@@ -200,8 +198,7 @@ throw(ORepFailed, ObjectNameAlready, InvalidObjectName, NameNotFound)
* проверки на, то не является ли имя ссылкой на объект или контекст
* т.к. для удаления ссылки на контекст нужен алгоритм посложнее...
*/
void
ObjectRepository
::
unregistration
(
const
string
&
name
,
const
string
&
section
)
const
throw
(
ORepFailed
,
NameNotFound
)
void
ObjectRepository
::
unregistration
(
const
string
&
name
,
const
string
&
section
)
const
{
ostringstream
err
;
CosNaming
::
Name_var
oName
=
omniURI
::
stringToName
(
name
.
c_str
());
...
...
@@ -241,7 +238,6 @@ throw(ORepFailed, NameNotFound)
* \sa unregistration(const string name, const string section)
*/
void
ObjectRepository
::
unregistration
(
const
string
&
fullName
)
const
throw
(
ORepFailed
,
NameNotFound
)
{
// string n(ORepHelpers::getShortName(fullName));
string
n
(
uconf
->
oind
->
getBaseName
(
fullName
));
...
...
@@ -251,7 +247,6 @@ throw(ORepFailed, NameNotFound)
// --------------------------------------------------------------------------
ObjectPtr
ObjectRepository
::
resolve
(
const
string
&
name
,
const
string
&
NSName
)
const
throw
(
ORepFailed
,
NameNotFound
)
{
ostringstream
err
;
...
...
@@ -308,7 +303,7 @@ throw(ORepFailed, NameNotFound)
* количество объектов в этой секции превышает заданное how_many.
* \exception ORepFailed - генерируется если произошла при получении доступа к секции
*/
bool
ObjectRepository
::
list
(
const
string
&
section
,
ListObjectName
*
ls
,
size_t
how_many
)
const
throw
(
ORepFailed
)
bool
ObjectRepository
::
list
(
const
string
&
section
,
ListObjectName
*
ls
,
size_t
how_many
)
const
{
return
list
(
section
,
ls
,
how_many
,
ObjectRef
);
}
...
...
@@ -322,7 +317,7 @@ bool ObjectRepository::list(const string& section, ListObjectName* ls, size_t ho
* количество объектов в этой секции превышает заданное how_many.
* \exception ORepFailed - генерируется если произошла при получении доступа к секции
*/
bool
ObjectRepository
::
listSections
(
const
string
&
in_section
,
ListObjectName
*
ls
,
size_t
how_many
)
const
throw
(
ORepFailed
)
bool
ObjectRepository
::
listSections
(
const
string
&
in_section
,
ListObjectName
*
ls
,
size_t
how_many
)
const
{
return
list
(
in_section
,
ls
,
how_many
,
Section
);
}
...
...
@@ -450,7 +445,6 @@ bool ObjectRepository::isExist( const ObjectPtr& oref ) const
* \exception ORepFailed - генерируется если произошла при получении доступа к секции
*/
bool
ObjectRepository
::
createSection
(
const
string
&
name
,
const
string
&
in_section
)
const
throw
(
ORepFailed
,
InvalidObjectName
)
{
char
bad
=
uniset
::
checkBadSymbols
(
name
);
...
...
@@ -480,7 +474,7 @@ throw(ORepFailed, InvalidObjectName)
* \param fullName - полное имя создаваемой секции
* \exception ORepFailed - генерируется если произошла при получении доступа к секции
*/
bool
ObjectRepository
::
createSectionF
(
const
string
&
fullName
)
const
throw
(
ORepFailed
,
InvalidObjectName
)
bool
ObjectRepository
::
createSectionF
(
const
string
&
fullName
)
const
{
string
name
(
ObjectIndex
::
getBaseName
(
fullName
));
string
sec
(
ORepHelpers
::
getSectionName
(
fullName
));
...
...
@@ -488,14 +482,14 @@ bool ObjectRepository::createSectionF( const string& fullName ) const throw(ORep
ulogrep
<<
name
<<
endl
;
ulogrep
<<
sec
<<
endl
;
if
(
sec
.
empty
()
)
if
(
sec
.
empty
()
)
{
ulogrep
<<
"SectionName is empty!!!"
<<
endl
;
ulogrep
<<
"Добавляем в "
<<
uconf
->
getRootSection
()
<<
endl
;
return
createSection
(
name
,
uconf
->
getRootSection
());
}
else
return
createSection
(
name
,
sec
);
return
createSection
(
name
,
sec
);
}
// ---------------------------------------------------------------------------------------------------------------
...
...
uniset2.includes
View file @
cadcafc2
...
...
@@ -29,4 +29,4 @@ Utilities/NullController
/usr/include/omniORB4
/usr/include/Poco
/usr/include/c++/5
/usr/include/libxml2
/libxml
/usr/include/libxml2
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