[opengtl-commits] [618] pass values as const ref, add a function to to set a set of parameters |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/opengtl-commits Archives
]
Revision: 618
Author: cyrille
Date: 2009-03-14 13:29:58 +0100 (Sat, 14 Mar 2009)
Log Message:
-----------
pass values as const ref, add a function to to set a set of parameters
Modified Paths:
--------------
trunk/OpenGTL/OpenShiva/OpenShiva/Library.cpp
trunk/OpenGTL/OpenShiva/OpenShiva/Library.h
Modified: trunk/OpenGTL/OpenShiva/OpenShiva/Library.cpp
===================================================================
--- trunk/OpenGTL/OpenShiva/OpenShiva/Library.cpp 2009-03-14 10:20:51 UTC (rev 617)
+++ trunk/OpenGTL/OpenShiva/OpenShiva/Library.cpp 2009-03-14 12:29:58 UTC (rev 618)
@@ -221,7 +221,16 @@
return d->source.metadata();
}
-void Library::setParameter( const GTLCore::String& _name, GTLCore::Value _value )
+void Library::setParameter( const GTLCore::String& _name, const GTLCore::Value& _value )
{
d->parameters[ _name ] = _value;
}
+
+void Library::setParameters( const std::map< GTLCore::String, GTLCore::Value>& _values )
+{
+ for( std::map< GTLCore::String, GTLCore::Value>::const_iterator it = _values.begin();
+ it != _values.end(); ++it)
+ {
+ d->parameters[ it->first ] = it->second;
+ }
+}
Modified: trunk/OpenGTL/OpenShiva/OpenShiva/Library.h
===================================================================
--- trunk/OpenGTL/OpenShiva/OpenShiva/Library.h 2009-03-14 10:20:51 UTC (rev 617)
+++ trunk/OpenGTL/OpenShiva/OpenShiva/Library.h 2009-03-14 12:29:58 UTC (rev 618)
@@ -21,6 +21,7 @@
#define _OPENSHIVA_LIBRARY_H_
#include <GTLCore/String.h>
+#include <map>
namespace GTLCore {
class ErrorMessage;
@@ -96,7 +97,11 @@
/**
* Set a given parameter to a given value
*/
- void setParameter( const GTLCore::String& _name, GTLCore::Value );
+ void setParameter( const GTLCore::String& _name, const GTLCore::Value& );
+ /**
+ * Set a list of parameters
+ */
+ void setParameters( const std::map< GTLCore::String, GTLCore::Value>& );
private:
struct Private;
Private* const d;