Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
e708cb1f
Commit
e708cb1f
authored
14 years ago
by
Tobias Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
return list of all generic properties
parent
658ed2bb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/base/src/export_helper/generic_property_def.hh
+3
-1
3 additions, 1 deletion
modules/base/src/export_helper/generic_property_def.hh
modules/base/src/generic_property.hh
+26
-6
26 additions, 6 deletions
modules/base/src/generic_property.hh
with
29 additions
and
7 deletions
modules/base/src/export_helper/generic_property_def.hh
+
3
−
1
View file @
e708cb1f
...
...
@@ -156,6 +156,7 @@ void const_generic_prop_def(O& bp_class)
.
def
(
"GetIntProp"
,
get_int2
)
.
def
(
"GetStringProp"
,
get_str1
)
.
def
(
"GetStringProp"
,
get_str2
)
.
def
(
"GetPropList"
,
&
C
::
GetPropList
)
.
def
(
"GetGenericBoolProperty"
,
&
depr_get_bool_a
<
C
>
)
.
def
(
"GetGenericBoolProperty"
,
&
depr_get_bool_b
<
C
>
)
.
def
(
"GetGenericFloatProperty"
,
&
depr_get_float_a
<
C
>
)
...
...
@@ -180,6 +181,7 @@ void generic_prop_def(O& bp_class)
.
def
(
"SetFloatProp"
,
&
C
::
SetFloatProp
)
.
def
(
"SetIntProp"
,
&
C
::
SetIntProp
)
.
def
(
"SetStringProp"
,
&
C
::
SetStringProp
)
.
def
(
"GetPropList"
,
&
C
::
GetPropList
)
.
def
(
"ClearGenericProperties"
,
&
depr_clear_props
<
C
>
)
.
def
(
"SetGenericIntProperty"
,
&
depr_set_int
<
C
>
)
.
def
(
"SetGenericFloatProperty"
,
&
depr_set_float
<
C
>
)
...
...
@@ -189,4 +191,4 @@ void generic_prop_def(O& bp_class)
;
}
#endif
\ No newline at end of file
#endif
This diff is collapsed.
Click to expand it.
modules/base/src/generic_property.hh
+
26
−
6
View file @
e708cb1f
...
...
@@ -31,6 +31,7 @@
#include
<exception>
#include
<sstream>
#include
<map>
#include
<vector>
#include
<boost/variant.hpp>
#include
<ost/module_config.hh>
...
...
@@ -109,6 +110,7 @@ public:
map_
->
erase
(
key
);
}
}
void
Assign
(
const
GenericPropContainerImpl
&
impl
)
{
if
(
impl
.
map_
)
{
...
...
@@ -130,6 +132,17 @@ public:
return
*
map_
;
}
std
::
vector
<
String
>
GetPropList
()
const
{
std
::
vector
<
String
>
prop_list
;
if
(
map_
)
{
PropertyMap
::
const_iterator
i
;
for
(
i
=
map_
->
begin
();
i
!=
map_
->
end
();
++
i
)
{
prop_list
.
push_back
(
i
->
first
);
}
}
return
prop_list
;
}
private
:
mutable
PropertyMap
*
map_
;
...
...
@@ -189,12 +202,13 @@ public:
rep
<<
this
->
GetImpl
()
->
GenericProp
(
key
);
return
rep
.
str
();
}
/// \brief returns String property, raises an exception if it does not exist
String
GetStringProp
(
const
String
&
key
)
const
{
CheckHandleValidity
(
*
static_cast
<
const
H
*>
(
this
));
return
this
->
gp_get
<
String
>
(
key
);
}
/// \brief returns String property, raises an exception if it does not exist
String
GetStringProp
(
const
String
&
key
)
const
{
CheckHandleValidity
(
*
static_cast
<
const
H
*>
(
this
));
return
this
->
gp_get
<
String
>
(
key
);
}
/// \brief returns floating point property, raises an exception if it does
/// not exist
...
...
@@ -279,6 +293,12 @@ public:
CheckHandleValidity
(
*
static_cast
<
const
H
*>
(
this
));
return
this
->
GetImpl
()
->
GetPropMap
();
}
std
::
vector
<
String
>
GetPropList
()
const
{
CheckHandleValidity
(
*
static_cast
<
const
H
*>
(
this
));
return
this
->
GetImpl
()
->
GetPropList
();
}
};
/// \brief base class for the handler classes
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment