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
b25663ab
Commit
b25663ab
authored
Oct 10, 2010
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавил функцию getIOType..
parent
1cefdb27
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
73 additions
and
5 deletions
+73
-5
libuniset.spec
conf/libuniset.spec
+1
-1
configure.ac
configure.ac
+2
-2
Configuration.h
include/Configuration.h
+2
-0
ObjectIndex.h
include/ObjectIndex.h
+1
-0
ObjectIndex_Array.h
include/ObjectIndex_Array.h
+1
-0
ObjectIndex_XML.h
include/ObjectIndex_XML.h
+2
-1
ObjectIndex_idXML.h
include/ObjectIndex_idXML.h
+1
-0
ObjectIndex_Array.cc
src/ObjectRepository/ObjectIndex_Array.cc
+9
-0
ObjectIndex_XML.cc
src/ObjectRepository/ObjectIndex_XML.cc
+9
-0
ObjectIndex_idXML.cc
src/ObjectRepository/ObjectIndex_idXML.cc
+12
-0
Configuration.cc
src/Various/Configuration.cc
+24
-0
conftest.cc
tests/conftest.cc
+9
-1
No files found.
conf/libuniset.spec
View file @
b25663ab
...
...
@@ -3,7 +3,7 @@
Name: libuniset
Version: 0.99
Release: eter
7
Release: eter
8
Summary: UniSet - library for building distributed industrial control systems
License: GPL
Group: Development/C++
...
...
configure.ac
View file @
b25663ab
...
...
@@ -3,7 +3,7 @@
# See doc: http://www.gnu.org/software/hello/manual/autoconf/Generic-Programs.html
# AC_PREREQ(2.59)
AC_INIT([uniset], [0.99.
1
], pv@etersoft.ru)
AC_INIT([uniset], [0.99.
2
], pv@etersoft.ru)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME,AC_PACKAGE_VERSION)
# AC_CONFIG_MACRO_DIR([m4])
...
...
@@ -30,7 +30,7 @@ AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
AM_PROG_LIBTOOL
LIBVER=0:9:
0
LIBVER=0:9:
2
AC_SUBST(LIBVER)
# Checks for libraries.
...
...
include/Configuration.h
View file @
b25663ab
...
...
@@ -110,6 +110,8 @@ namespace UniSetTypes
xmlNode
*
getXMLServicesSection
();
xmlNode
*
getXMLNodesSection
();
xmlNode
*
getXMLObjectNode
(
UniSetTypes
::
ObjectId
);
UniversalIO
::
IOTypes
getIOType
(
UniSetTypes
::
ObjectId
);
UniversalIO
::
IOTypes
getIOType
(
const
std
::
string
name
);
// net
inline
unsigned
int
getCountOfNet
()
const
{
return
countOfNet
;
}
...
...
include/ObjectIndex.h
View file @
b25663ab
...
...
@@ -42,6 +42,7 @@ class ObjectIndex
// info
virtual
const
ObjectInfo
*
getObjectInfo
(
const
ObjectId
)
=
0
;
virtual
const
ObjectInfo
*
getObjectInfo
(
const
std
::
string
name
)
=
0
;
// создание полного имени в репозитории по паре имя:узел
static
std
::
string
mkRepName
(
const
std
::
string
repname
,
const
std
::
string
nodename
);
...
...
include/ObjectIndex_Array.h
View file @
b25663ab
...
...
@@ -48,6 +48,7 @@ class ObjectIndex_Array:
virtual
const
ObjectInfo
*
getObjectInfo
(
const
ObjectId
);
virtual
const
ObjectInfo
*
getObjectInfo
(
const
std
::
string
name
);
virtual
ObjectId
getIdByName
(
const
std
::
string
&
name
);
virtual
std
::
string
getMapName
(
const
ObjectId
id
);
virtual
std
::
string
getTextName
(
const
ObjectId
id
);
...
...
include/ObjectIndex_XML.h
View file @
b25663ab
...
...
@@ -47,7 +47,8 @@ class ObjectIndex_XML:
ObjectIndex_XML
(
UniXML
&
xml
,
int
minSize
=
1000
);
virtual
~
ObjectIndex_XML
();
virtual
const
ObjectInfo
*
getObjectInfo
(
const
ObjectId
);
virtual
const
UniSetTypes
::
ObjectInfo
*
getObjectInfo
(
const
ObjectId
);
virtual
const
UniSetTypes
::
ObjectInfo
*
getObjectInfo
(
const
std
::
string
name
);
virtual
ObjectId
getIdByName
(
const
std
::
string
&
name
);
virtual
std
::
string
getMapName
(
const
ObjectId
id
);
virtual
std
::
string
getTextName
(
const
ObjectId
id
);
...
...
include/ObjectIndex_idXML.h
View file @
b25663ab
...
...
@@ -17,6 +17,7 @@ class ObjectIndex_idXML:
virtual
~
ObjectIndex_idXML
();
virtual
const
UniSetTypes
::
ObjectInfo
*
getObjectInfo
(
const
UniSetTypes
::
ObjectId
);
virtual
const
UniSetTypes
::
ObjectInfo
*
getObjectInfo
(
const
std
::
string
name
);
virtual
UniSetTypes
::
ObjectId
getIdByName
(
const
std
::
string
&
name
);
virtual
std
::
string
getMapName
(
const
UniSetTypes
::
ObjectId
id
);
virtual
std
::
string
getTextName
(
const
UniSetTypes
::
ObjectId
id
);
...
...
src/ObjectRepository/ObjectIndex_Array.cc
View file @
b25663ab
...
...
@@ -117,3 +117,12 @@ const ObjectInfo* ObjectIndex_Array::getObjectInfo( const ObjectId id )
}
// -----------------------------------------------------------------------------------------
const
ObjectInfo
*
ObjectIndex_Array
::
getObjectInfo
(
const
std
::
string
name
)
{
MapObjectKey
::
iterator
it
=
mok
.
find
(
name
);
if
(
it
!=
mok
.
end
()
)
return
&
(
objectInfo
[
it
->
second
]);
return
NULL
;
}
// ------------------------------------------------------------------------------------------
src/ObjectRepository/ObjectIndex_XML.cc
View file @
b25663ab
...
...
@@ -285,3 +285,12 @@ const ObjectInfo* ObjectIndex_XML::getObjectInfo( const ObjectId id )
return
NULL
;
}
// ------------------------------------------------------------------------------------------
const
ObjectInfo
*
ObjectIndex_XML
::
getObjectInfo
(
const
std
::
string
name
)
{
MapObjectKey
::
iterator
it
=
mok
.
find
(
name
);
if
(
it
!=
mok
.
end
()
)
return
&
(
omap
[
it
->
second
]);
return
NULL
;
}
// ------------------------------------------------------------------------------------------
src/ObjectRepository/ObjectIndex_idXML.cc
View file @
b25663ab
...
...
@@ -229,3 +229,15 @@ const ObjectInfo* ObjectIndex_idXML::getObjectInfo( const ObjectId id )
return
NULL
;
}
// ------------------------------------------------------------------------------------------
const
ObjectInfo
*
ObjectIndex_idXML
::
getObjectInfo
(
const
std
::
string
name
)
{
const
char
*
n
=
name
.
c_str
();
for
(
MapObjects
::
iterator
it
=
omap
.
begin
();
it
!=
omap
.
end
();
it
++
)
{
if
(
!
strcmp
(
it
->
second
.
repName
,
n
)
)
return
&
(
it
->
second
);
}
return
NULL
;
}
// ------------------------------------------------------------------------------------------
src/Various/Configuration.cc
View file @
b25663ab
...
...
@@ -1036,6 +1036,30 @@ xmlNode* Configuration::getXMLObjectNode( UniSetTypes::ObjectId id )
return
0
;
}
// -------------------------------------------------------------------------
UniversalIO
::
IOTypes
Configuration
::
getIOType
(
UniSetTypes
::
ObjectId
id
)
{
const
ObjectInfo
*
i
=
oind
->
getObjectInfo
(
id
);
if
(
i
&&
(
xmlNode
*
)(
i
->
data
)
)
{
UniXML_iterator
it
((
xmlNode
*
)(
i
->
data
));
return
UniSetTypes
::
getIOType
(
it
.
getProp
(
"iotype"
)
);
}
return
UniversalIO
::
UnknownIOType
;
}
// -------------------------------------------------------------------------
UniversalIO
::
IOTypes
Configuration
::
getIOType
(
const
std
::
string
name
)
{
const
ObjectInfo
*
i
=
oind
->
getObjectInfo
(
name
);
if
(
i
&&
(
xmlNode
*
)(
i
->
data
)
)
{
UniXML_iterator
it
((
xmlNode
*
)(
i
->
data
));
return
UniSetTypes
::
getIOType
(
it
.
getProp
(
"iotype"
)
);
}
return
UniversalIO
::
UnknownIOType
;
}
// -------------------------------------------------------------------------
void
uniset_init
(
int
argc
,
const
char
*
const
*
argv
,
const
std
::
string
xmlfile
)
{
string
confile
=
UniSetTypes
::
getArgParam
(
"--confile"
,
argc
,
argv
,
xmlfile
);
...
...
tests/conftest.cc
View file @
b25663ab
...
...
@@ -20,8 +20,16 @@ int main(int argc, const char **argv)
conf
=
new
Configuration
(
argc
,
argv
,
confile
);
string
t
(
conf
->
oind
->
getTextName
(
1
));
cout
<<
"**** check getTextName: "
<<
(
t
.
empty
()
?
"FAILED"
:
"OK"
)
<<
endl
;
string
mn
(
conf
->
oind
->
getMapName
(
1
));
cout
<<
"**** check getMapName: "
<<
(
mn
.
empty
()
?
"FAILED"
:
"OK"
)
<<
endl
;
UniversalIO
::
IOTypes
t1
=
conf
->
getIOType
(
1
);
cout
<<
"**** check getIOType(id): ("
<<
t1
<<
") "
<<
(
t1
==
UniversalIO
::
UnknownIOType
?
"FAILED"
:
"OK"
)
<<
endl
;
UniversalIO
::
IOTypes
t2
=
conf
->
getIOType
(
mn
);
cout
<<
"**** check getIOType(name): ("
<<
t2
<<
") "
<<
(
t2
==
UniversalIO
::
UnknownIOType
?
"FAILED"
:
"OK"
)
<<
endl
;
return
0
;
}
catch
(
SystemError
&
err
)
...
...
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