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
1add5ffe
Commit
1add5ffe
authored
Nov 01, 2015
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Продолжение избавления от char*
parent
60139882
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
32 additions
and
46 deletions
+32
-46
admin.cc
Utilities/Admin/admin.cc
+2
-2
UniSetTypes.h
include/UniSetTypes.h
+3
-3
UInterface.cc
src/Interfaces/UInterface.cc
+1
-1
ObjectIndex_Array.cc
src/ObjectRepository/ObjectIndex_Array.cc
+2
-2
ObjectIndex_XML.cc
src/ObjectRepository/ObjectIndex_XML.cc
+5
-14
ObjectIndex_idXML.cc
src/ObjectRepository/ObjectIndex_idXML.cc
+5
-10
PassiveObject.cc
src/ObjectRepository/PassiveObject.cc
+2
-2
UniSetObject.cc
src/ObjectRepository/UniSetObject.cc
+10
-10
IOController.cc
src/Processes/IOController.cc
+2
-2
No files found.
Utilities/Admin/admin.cc
View file @
1add5ffe
...
...
@@ -379,7 +379,7 @@ static bool commandToAll(const string& section, std::shared_ptr<ObjectRepository
try
{
ListObjectName
ls
;
rep
->
list
(
section
.
c_str
()
,
&
ls
);
rep
->
list
(
section
,
&
ls
);
if
(
ls
.
empty
()
)
{
...
...
@@ -401,7 +401,7 @@ static bool commandToAll(const string& section, std::shared_ptr<ObjectRepository
{
string
ob
(
*
li
);
buf
=
section
+
"/"
+
ob
;
fullName
=
buf
.
c_str
()
;
fullName
=
buf
;
try
{
...
...
include/UniSetTypes.h
View file @
1add5ffe
...
...
@@ -143,11 +143,11 @@ namespace UniSetTypes
{
ObjectInfo
()
:
id
(
DefaultObjectId
),
repName
(
0
),
textName
(
0
),
data
(
0
)
{}
repName
(
""
),
textName
(
""
),
data
(
0
)
{}
ObjectId
id
;
/*!< идентификатор */
char
*
repName
;
/*!< текстовое имя для регистрации в репозитории */
char
*
textName
;
/*!< текстовое имя */
std
::
string
repName
;
/*!< текстовое имя для регистрации в репозитории */
std
::
string
textName
;
/*!< текстовое имя */
void
*
data
;
inline
bool
operator
<
(
const
ObjectInfo
&
o
)
const
...
...
src/Interfaces/UInterface.cc
View file @
1add5ffe
...
...
@@ -864,7 +864,7 @@ throw(ResolveNameError, UniSetTypes::TimeOut )
if
(
CORBA
::
is_nil
(
orb
)
)
orb
=
uconf
->
getORB
();
ctx
=
ORepHelpers
::
getRootNamingContext
(
orb
,
nodeName
.
c_str
()
);
ctx
=
ORepHelpers
::
getRootNamingContext
(
orb
,
nodeName
);
break
;
}
// catch( const CORBA::COMM_FAILURE& ex )
...
...
src/ObjectRepository/ObjectIndex_Array.cc
View file @
1add5ffe
...
...
@@ -43,7 +43,7 @@ ObjectIndex_Array::ObjectIndex_Array( const ObjectInfo* objectInfo ):
{
for
(
numOfObject
=
0
;;
numOfObject
++
)
{
if
(
!
objectInfo
[
numOfObject
].
repName
)
if
(
objectInfo
[
numOfObject
].
repName
.
empty
()
)
break
;
assert
(
numOfObject
==
objectInfo
[
numOfObject
].
id
);
...
...
@@ -93,7 +93,7 @@ std::ostream& ObjectIndex_Array::printMap( std::ostream& os )
for
(
auto
i
=
0
;;
i
++
)
{
if
(
!
objectInfo
[
i
].
repName
)
if
(
objectInfo
[
i
].
repName
.
empty
()
)
break
;
assert
(
i
==
objectInfo
[
i
].
id
);
...
...
src/ObjectRepository/ObjectIndex_XML.cc
View file @
1add5ffe
...
...
@@ -48,11 +48,6 @@ ObjectIndex_XML::ObjectIndex_XML( const std::shared_ptr<UniXML>& xml, int minSiz
// -----------------------------------------------------------------------------------------
ObjectIndex_XML
::~
ObjectIndex_XML
()
{
for
(
auto
&
it
:
omap
)
{
delete
[]
it
.
repName
;
delete
[]
it
.
textName
;
}
}
// -----------------------------------------------------------------------------------------
ObjectId
ObjectIndex_XML
::
getIdByName
(
const
string
&
name
)
...
...
@@ -92,7 +87,7 @@ std::ostream& ObjectIndex_XML::printMap( std::ostream& os )
for
(
auto
it
=
omap
.
begin
();
it
!=
omap
.
end
();
++
it
)
{
if
(
it
->
repName
==
NULL
)
if
(
it
->
repName
.
empty
()
)
continue
;
os
<<
setw
(
5
)
<<
it
->
id
<<
" "
...
...
@@ -186,9 +181,8 @@ unsigned int ObjectIndex_XML::read_section( const std::shared_ptr<UniXML>& xml,
// name
ostringstream
n
;
n
<<
secname
<<
xml
->
getProp
(
it
,
"name"
);
delete
[]
omap
[
ind
].
repName
;
const
string
name
(
n
.
str
());
omap
[
ind
].
repName
=
uni_strdup
(
name
)
;
omap
[
ind
].
repName
=
name
;
// mok
mok
[
name
]
=
ind
;
// mok[omap[ind].repName] = ind;
...
...
@@ -199,8 +193,7 @@ unsigned int ObjectIndex_XML::read_section( const std::shared_ptr<UniXML>& xml,
if
(
textname
.
empty
()
)
textname
=
xml
->
getProp
(
it
,
"name"
);
delete
[]
omap
[
ind
].
textName
;
omap
[
ind
].
textName
=
uni_strdup
(
textname
);
omap
[
ind
].
textName
=
textname
;
omap
[
ind
].
data
=
(
void
*
)(
xmlNode
*
)
it
;
...
...
@@ -255,8 +248,7 @@ unsigned int ObjectIndex_XML::read_nodes( const std::shared_ptr<UniXML>& xml, co
omap
[
ind
].
id
=
ind
;
string
nodename
(
xml
->
getProp
(
it
,
"name"
));
delete
[]
omap
[
ind
].
repName
;
omap
[
ind
].
repName
=
uni_strdup
(
nodename
);
omap
[
ind
].
repName
=
nodename
;
// textname
string
textname
(
xml
->
getProp
(
it
,
"textname"
));
...
...
@@ -264,8 +256,7 @@ unsigned int ObjectIndex_XML::read_nodes( const std::shared_ptr<UniXML>& xml, co
if
(
textname
.
empty
()
)
textname
=
nodename
;
delete
[]
omap
[
ind
].
textName
;
omap
[
ind
].
textName
=
uni_strdup
(
textname
);
omap
[
ind
].
textName
=
textname
;
omap
[
ind
].
data
=
(
void
*
)(
xmlNode
*
)(
it
);
//
mok
[
omap
[
ind
].
repName
]
=
ind
;
...
...
src/ObjectRepository/ObjectIndex_idXML.cc
View file @
1add5ffe
...
...
@@ -26,11 +26,6 @@ ObjectIndex_idXML::ObjectIndex_idXML( const shared_ptr<UniXML>& xml )
// -----------------------------------------------------------------------------------------
ObjectIndex_idXML
::~
ObjectIndex_idXML
()
{
for
(
auto
&
it
:
omap
)
{
delete
[]
it
.
second
.
repName
;
delete
[]
it
.
second
.
textName
;
}
}
// -----------------------------------------------------------------------------------------
ObjectId
ObjectIndex_idXML
::
getIdByName
(
const
string
&
name
)
...
...
@@ -74,7 +69,7 @@ std::ostream& ObjectIndex_idXML::printMap( std::ostream& os )
for
(
auto
it
=
omap
.
begin
();
it
!=
omap
.
end
();
++
it
)
{
if
(
it
->
second
.
repName
==
NULL
)
if
(
it
->
second
.
repName
.
empty
()
)
continue
;
os
<<
setw
(
5
)
<<
it
->
second
.
id
<<
" "
...
...
@@ -158,14 +153,14 @@ void ObjectIndex_idXML::read_section( const std::shared_ptr<UniXML>& xml, const
ostringstream
n
;
n
<<
secname
<<
it
.
getProp
(
"name"
);
const
string
name
(
n
.
str
());
inf
.
repName
=
uni_strdup
(
name
)
;
inf
.
repName
=
name
;
string
textname
(
xml
->
getProp
(
it
,
"textname"
));
if
(
textname
.
empty
()
)
textname
=
xml
->
getProp
(
it
,
"name"
);
inf
.
textName
=
uni_strdup
(
textname
)
;
inf
.
textName
=
textname
;
inf
.
data
=
(
void
*
)(
xmlNode
*
)(
it
);
mok
.
emplace
(
name
,
inf
.
id
);
...
...
@@ -209,7 +204,7 @@ void ObjectIndex_idXML::read_nodes( const std::shared_ptr<UniXML>& xml, const st
}
string
name
(
it
.
getProp
(
"name"
));
inf
.
repName
=
uni_strdup
(
name
)
;
inf
.
repName
=
name
;
// textname
string
textname
(
xml
->
getProp
(
it
,
"textname"
));
...
...
@@ -217,7 +212,7 @@ void ObjectIndex_idXML::read_nodes( const std::shared_ptr<UniXML>& xml, const st
if
(
textname
.
empty
()
)
textname
=
name
;
inf
.
textName
=
uni_strdup
(
textname
)
;
inf
.
textName
=
textname
;
inf
.
data
=
(
void
*
)(
xmlNode
*
)(
it
);
omap
.
emplace
(
inf
.
id
,
inf
);
...
...
src/ObjectRepository/PassiveObject.cc
View file @
1add5ffe
...
...
@@ -42,7 +42,7 @@ PassiveObject::PassiveObject( UniSetTypes::ObjectId id ):
id
(
id
)
{
string
myfullname
=
uniset_conf
()
->
oind
->
getNameById
(
id
);
myname
=
ORepHelpers
::
getShortName
(
myfullname
.
c_str
()
);
myname
=
ORepHelpers
::
getShortName
(
myfullname
);
}
PassiveObject
::
PassiveObject
(
ObjectId
id
,
ProxyManager
*
mngr
)
:
...
...
@@ -50,7 +50,7 @@ PassiveObject::PassiveObject( ObjectId id, ProxyManager* mngr ):
id
(
id
)
{
string
myfullname
=
uniset_conf
()
->
oind
->
getNameById
(
id
);
myname
=
ORepHelpers
::
getShortName
(
myfullname
.
c_str
()
);
myname
=
ORepHelpers
::
getShortName
(
myfullname
);
if
(
mngr
)
mngr
->
attachObject
(
this
,
id
);
...
...
src/ObjectRepository/UniSetObject.cc
View file @
1add5ffe
...
...
@@ -85,8 +85,8 @@ UniSetObject::UniSetObject( ObjectId id ):
if
(
myid
>=
0
)
{
string
myfullname
=
ui
->
getNameById
(
id
);
myname
=
ORepHelpers
::
getShortName
(
myfullname
.
c_str
()
);
section
=
ORepHelpers
::
getSectionName
(
myfullname
.
c_str
()
);
myname
=
ORepHelpers
::
getShortName
(
myfullname
);
section
=
ORepHelpers
::
getSectionName
(
myfullname
);
}
else
{
...
...
@@ -196,8 +196,8 @@ void UniSetObject::setID( UniSetTypes::ObjectId id )
throw
ObjectNameAlready
(
"ObjectId already set(setID)"
);
string
myfullname
=
ui
->
getNameById
(
id
);
myname
=
ORepHelpers
::
getShortName
(
myfullname
.
c_str
()
);
section
=
ORepHelpers
::
getSectionName
(
myfullname
.
c_str
()
);
myname
=
ORepHelpers
::
getShortName
(
myfullname
);
section
=
ORepHelpers
::
getSectionName
(
myfullname
);
myid
=
id
;
ui
->
initBackId
(
myid
);
}
...
...
@@ -347,7 +347,7 @@ void UniSetObject::registered()
{
uwarn
<<
myname
<<
"(registered): unknown my manager"
<<
endl
;
string
err
(
myname
+
": unknown my manager"
);
throw
ORepFailed
(
err
.
c_str
()
);
throw
ORepFailed
(
err
);
}
{
...
...
@@ -390,13 +390,13 @@ void UniSetObject::registered()
catch
(
ORepFailed
)
{
string
err
(
myname
+
": don`t registration in object reposotory"
);
throw
ORepFailed
(
err
.
c_str
()
);
throw
ORepFailed
(
err
);
}
catch
(
const
Exception
&
ex
)
{
uwarn
<<
myname
<<
"(registered): "
<<
ex
<<
endl
;
string
err
(
myname
+
": don`t registration in object reposotory"
);
throw
ORepFailed
(
err
.
c_str
()
);
throw
ORepFailed
(
err
);
}
regOK
=
true
;
...
...
@@ -741,7 +741,7 @@ bool UniSetObject::activate()
if
(
poa
==
NULL
||
CORBA
::
is_nil
(
poa
)
)
{
string
err
(
myname
+
": не задан менеджер"
);
throw
ORepFailed
(
err
.
c_str
()
);
throw
ORepFailed
(
err
);
}
if
(
uniset_conf
()
->
isTransientIOR
()
)
...
...
@@ -931,8 +931,8 @@ UniSetTypes::SimpleInfo* UniSetObject::getInfo()
// info << "\n";
SimpleInfo
*
res
=
new
SimpleInfo
();
res
->
info
=
info
.
str
().
c_str
();
// CORBA::string_dup(info.str().c_str());
res
->
id
=
myid
;
res
->
info
=
info
.
str
().
c_str
();
// CORBA::string_dup(info.str().c_str());
res
->
id
=
myid
;
return
res
;
// ._retn();
}
...
...
src/Processes/IOController.cc
View file @
1add5ffe
...
...
@@ -366,7 +366,7 @@ void IOController::ioRegistration( std::shared_ptr<USensorInfo>& ainf, bool forc
ostringstream
err
;
err
<<
"(IOCOntroller::ioRegistration): КОНТРОЛЛЕРУ НЕ ЗАДАН ObjectId. Регистрация невозможна."
;
uwarn
<<
err
.
str
()
<<
endl
;
throw
ResolveNameError
(
err
.
str
()
.
c_str
()
);
throw
ResolveNameError
(
err
.
str
());
}
{
...
...
@@ -382,7 +382,7 @@ void IOController::ioRegistration( std::shared_ptr<USensorInfo>& ainf, bool forc
ostringstream
err
;
err
<<
"Попытка повторной регистрации датчика("
<<
ainf
->
si
.
id
<<
"). имя: "
<<
uniset_conf
()
->
oind
->
getNameById
(
ainf
->
si
.
id
);
throw
ObjectNameAlready
(
err
.
str
()
.
c_str
()
);
throw
ObjectNameAlready
(
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