[opengtl-commits] [504] * add a ValueEntry to hold metadata lines which contains a value and not a string

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 504
Author:   cyrille
Date:     2008-11-27 20:22:19 +0100 (Thu, 27 Nov 2008)

Log Message:
-----------
* add a ValueEntry to hold metadata lines which contains a value and not a string
* makes ParameterEntry inherits group

Modified Paths:
--------------
    trunk/OpenGTL/OpenGTL/GTLCore/CMakeLists.txt
    trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Entry.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Entry.h
    trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Factory_p.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Factory_p.h
    trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Group.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Group.h
    trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.h
    trunk/OpenGTL/OpenGTL/GTLCore/tests/TestMetadata.h

Added Paths:
-----------
    trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ValueEntry.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ValueEntry.h


Modified: trunk/OpenGTL/OpenGTL/GTLCore/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/CMakeLists.txt	2008-11-26 23:10:07 UTC (rev 503)
+++ trunk/OpenGTL/OpenGTL/GTLCore/CMakeLists.txt	2008-11-27 19:22:19 UTC (rev 504)
@@ -63,6 +63,7 @@
   Metadata/Group.cpp
   Metadata/ParameterEntry.cpp
   Metadata/TextEntry.cpp
+  Metadata/ValueEntry.cpp
   Metadata/Factory_p.cpp
   ${LLVM_NATIVE_OBJECTS}
   )

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Entry.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Entry.cpp	2008-11-26 23:10:07 UTC (rev 503)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Entry.cpp	2008-11-27 19:22:19 UTC (rev 504)
@@ -54,3 +54,8 @@
 {
   return 0;
 }
+
+const ValueEntry* Entry::asValueEntry() const
+{
+  return 0;
+}

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Entry.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Entry.h	2008-11-26 23:10:07 UTC (rev 503)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Entry.h	2008-11-27 19:22:19 UTC (rev 504)
@@ -27,6 +27,7 @@
     class Group;
     class ParameterEntry;
     class TextEntry;
+    class ValueEntry;
     /**
      * @ingroup GTLCore_Metadata
      */
@@ -34,6 +35,7 @@
       friend class Group;
       friend class ParameterEntry;
       friend class TextEntry;
+      friend class ValueEntry;
       friend class Factory;
       private:
         Entry( const GTLCore::String& _name );
@@ -44,6 +46,7 @@
         virtual const Group* asGroup() const;
         virtual const ParameterEntry* asParameterEntry() const;
         virtual const TextEntry* asTextEntry() const;
+        virtual const ValueEntry* asValueEntry() const;
       private:
         struct Private;
         Private* const d;

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Factory_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Factory_p.cpp	2008-11-26 23:10:07 UTC (rev 503)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Factory_p.cpp	2008-11-27 19:22:19 UTC (rev 504)
@@ -23,40 +23,36 @@
 #include "Group.h"
 #include "ParameterEntry.h"
 #include "TextEntry.h"
+#include "ValueEntry.h"
 
 using namespace GTLCore::Metadata;
 
-Entry* Factory::createEntry( const GTLCore::String& _name)
+const Entry* Factory::createEntry( const GTLCore::String& _name)
 {
   return new Entry( _name );
 }
 
-TextEntry* Factory::createTextEntry( const GTLCore::String& _name, const GTLCore::String& _text)
+const TextEntry* Factory::createTextEntry( const GTLCore::String& _name, const GTLCore::String& _text)
 {
   return new TextEntry( _name, _text );
 }
 
-Group* Factory::createGroup( const GTLCore::String& _name, const std::list< Entry* >& _entries)
+const Group* Factory::createGroup( const GTLCore::String& _name, const std::list< const Entry* >& _entries)
 {
   return new Group( _name, _entries );
 }
 
-void Factory::deleteEntry( Entry* _entry )
+void Factory::deleteEntry( const Entry* _entry )
 {
   delete _entry;
 }
 
-ParameterEntry* Factory::createParameterEntry( const GTLCore::String& _name, int _minimumValue, int _maximumValue, int _defaultValue )
+const ParameterEntry* Factory::createParameterEntry( const GTLCore::String& _name, const std::list< const Entry* >& _entries )
 {
-  return new ParameterEntry( _name, _minimumValue, _maximumValue, _defaultValue );
+  return new ParameterEntry( _name, _entries );
 }
 
-ParameterEntry* Factory::createParameterEntry( const GTLCore::String& _name, float _minimumValue, float _maximumValue, float _defaultValue )
+const ValueEntry* Factory::createValueEntry( const GTLCore::String& _name, const GTLCore::Value& _value  )
 {
-  return new ParameterEntry( _name, _minimumValue, _maximumValue, _defaultValue );
+  return new ValueEntry( _name, _value );
 }
-
-ParameterEntry* Factory::createParameterEntry( const GTLCore::String& _name, const GTLCore::Value& _defaultValue )
-{
-  return new ParameterEntry( _name, _defaultValue );
-}

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Factory_p.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Factory_p.h	2008-11-26 23:10:07 UTC (rev 503)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Factory_p.h	2008-11-27 19:22:19 UTC (rev 504)
@@ -29,6 +29,7 @@
     class Group;
     class ParameterEntry;
     class TextEntry;
+    class ValueEntry;
     /**
      * @internal
      * @ingroup GTLCore_Metadata
@@ -37,13 +38,12 @@
     class Factory {
       Factory();
       public:
-        static Entry* createEntry( const GTLCore::String& _name);
-        static TextEntry* createTextEntry( const GTLCore::String& _name, const GTLCore::String& _text);
-        static Group* createGroup( const GTLCore::String& _name, const std::list< Entry* >& _entries);
-        static void deleteEntry( Entry* );
-        static ParameterEntry* createParameterEntry( const GTLCore::String& _name, int _minimumValue, int _maximumValue, int _defaultValue );
-        static ParameterEntry* createParameterEntry( const GTLCore::String& _name, float _minimumValue, float _maximumValue, float _defaultValue );
-        static ParameterEntry* createParameterEntry( const GTLCore::String& _name, const GTLCore::Value& _defaultValue );
+        static const Entry* createEntry( const GTLCore::String& _name);
+        static const TextEntry* createTextEntry( const GTLCore::String& _name, const GTLCore::String& _text);
+        static const Group* createGroup( const GTLCore::String& _name, const std::list< const Entry* >& _entries);
+        static void deleteEntry( const Entry* );
+        static const ParameterEntry* createParameterEntry( const GTLCore::String& _name, const std::list< const Entry* >& _entries );
+        static const ValueEntry* createValueEntry( const GTLCore::String& _name, const GTLCore::Value& _value  );
     };
   }
 }

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Group.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Group.cpp	2008-11-26 23:10:07 UTC (rev 503)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Group.cpp	2008-11-27 19:22:19 UTC (rev 504)
@@ -25,25 +25,37 @@
 using namespace GTLCore::Metadata;
 
 struct Group::Private {
-  std::list< Entry* > entries;
+  std::list< const Entry* > entries;
 };
 
-Group::Group( const GTLCore::String& _name, const std::list< Entry* >& _entries) : Entry( _name), d(new Private)
+Group::Group( const GTLCore::String& _name, const std::list< const Entry* >& _entries) : Entry( _name), d(new Private)
 {
   d->entries = _entries;
 }
 
 Group::~Group()
 {
-  foreach( Entry* entry, d->entries )
+  foreach( const Entry* entry, d->entries )
   {
     Factory::deleteEntry( entry );
   }
   delete d;
 }
 
-const std::list< Entry* >& Group::entries() const
+const Entry* Group::entry( const GTLCore::String& _name ) const
 {
+  foreach( const Entry* entry, d->entries )
+  {
+    if( entry->name() == _name )
+    {
+      return entry;
+    }
+  }
+  return 0;
+}
+
+const std::list< const Entry* >& Group::entries() const
+{
   return d->entries;
 }
 

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Group.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Group.h	2008-11-26 23:10:07 UTC (rev 503)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Metadata/Group.h	2008-11-27 19:22:19 UTC (rev 504)
@@ -22,6 +22,10 @@
 
 #include <GTLCore/Metadata/Entry.h>
 
+namespace OpenShiva {
+  class KernelMetadata;
+}
+
 namespace GTLCore {
   namespace Metadata {
     /**
@@ -29,10 +33,13 @@
      */
     class Group : public Entry {
         friend class Factory;
-        Group( const GTLCore::String& _name, const std::list< Entry* >& _entries);
+        friend class ParameterEntry;
+        friend class OpenShiva::KernelMetadata;
+        Group( const GTLCore::String& _name, const std::list< const Entry* >& _entries);
         virtual ~Group();
       public:
-        const std::list< Entry* >& entries() const;
+        const Entry* entry( const GTLCore::String& _name ) const;
+        const std::list< const Entry* >& entries() const;
         virtual const Group* asGroup() const;
       private:
         struct Private;

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.cpp	2008-11-26 23:10:07 UTC (rev 503)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.cpp	2008-11-27 19:22:19 UTC (rev 504)
@@ -19,10 +19,14 @@
 
 #include "ParameterEntry.h"
 
+#include "../Debug.h"
 #include "../Value.h"
 #include "../Type.h"
 #include "../TypeManager.h"
 
+#include "TextEntry.h"
+#include "ValueEntry.h"
+
 using namespace GTLCore::Metadata;
 
 struct ParameterEntry::Private {
@@ -30,11 +34,107 @@
   Value maximumValue;
   Value defaultValue;
   const Type* type;
+  GTLCore::String description;
 };
 
+ParameterEntry::ParameterEntry( const GTLCore::String& _name, const std::list< const Entry* >& _entries ) : Group( _name, _entries ), d(new Private)
+{
+  // Type
+  const Entry* typeEntry = entry( "type" );
+  if( typeEntry )
+  {
+    const TextEntry* v = typeEntry->asTextEntry();
+    GTL_ASSERT( v );
+    if( v->text() == "int" )
+    {
+      d->type = Type::Integer32;
+    } else if( v->text() == "float" ) {
+      d->type = Type::Float;
+    } else if( v->text() == "curve" ) {
+      d->type = TypeManager::getVector( Type::Float, 2 );
+    }
+  }
+  // DefaultValue
+  const Entry* defaultEntry = entry( "defaultValue" );
+  if( defaultEntry )
+  {
+    const ValueEntry* v = defaultEntry->asValueEntry();
+    GTL_ASSERT( v );
+    d->defaultValue = v->value();
+    if( not d->type )
+    {
+      d->type = v->value().type();
+    }
+  }
+  // MinValue
+  const Entry* minEntry = entry( "minValue" );
+  if( minEntry )
+  {
+    const ValueEntry* v = minEntry->asValueEntry();
+    GTL_ASSERT( v );
+    d->minimumValue = v->value();
+    if( not d->type )
+    {
+      d->type = v->value().type();
+    }
+  }
+  // MaxValue
+  const Entry* maxEntry = entry( "maxValue" );
+  if( maxEntry )
+  {
+    const ValueEntry* v = maxEntry->asValueEntry();
+    GTL_ASSERT( v );
+    d->maximumValue = v->value();
+    if( not d->type )
+    {
+      d->type = v->value().type();
+    }
+  }
+  // Description
+  const Entry* descriptionEntry = entry( "description" );
+  if( descriptionEntry )
+  {
+    const TextEntry* v = descriptionEntry->asTextEntry();
+    GTL_ASSERT( v );
+    d->description = v->text();
+  }
+  GTL_ASSERT( d->type );
+  if( not minEntry )
+  {
+    if( d->type == Type::Integer32 )
+    {
+      d->minimumValue.setInt32( 0 );
+    } else if( d->type == Type::Float )
+    {
+      d->minimumValue.setFloat( 0.0 );
+    }
+  }
+  if( not maxEntry )
+  {
+    if( d->type == Type::Integer32 )
+    {
+      d->maximumValue.setInt32( 100 );
+    } else if( d->type == Type::Float )
+    {
+      d->maximumValue.setFloat( 1.0 );
+    }
+  }
+  if( not defaultEntry )
+  {
+    if( d->type == Type::Integer32 )
+    {
+      d->defaultValue.setInt32( 50 );
+    } else if( d->type == Type::Float )
+    {
+      d->defaultValue.setFloat( 0.5 );
+    }
+  }
+}
+
+#if 0
+
 ParameterEntry::ParameterEntry( const GTLCore::String& _name, int _minimumValue, int _maximumValue, int _defaultValue ) : Entry( _name ), d(new Private)
 {
-  d->type = GTLCore::Type::Integer32;
   d->minimumValue.setInt32( _minimumValue );
   d->maximumValue.setInt32( _maximumValue );
   d->defaultValue.setInt32( _defaultValue );
@@ -62,6 +162,8 @@
     d->maximumValue.setFloat( 1.0 );
   }
 }
+
+#endif
         
 ParameterEntry::~ParameterEntry()
 {

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.h	2008-11-26 23:10:07 UTC (rev 503)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.h	2008-11-27 19:22:19 UTC (rev 504)
@@ -20,7 +20,7 @@
 #ifndef _GTLCORE_METADATA_PARAMETER_ENTRY_H_
 #define _GTLCORE_METADATA_PARAMETER_ENTRY_H_
 
-#include <GTLCore/Metadata/Entry.h>
+#include <GTLCore/Metadata/Group.h>
 
 namespace GTLCore {
   class Type;
@@ -29,18 +29,17 @@
     /**
      * @ingroup GTLCore_Metadata
      */
-    class ParameterEntry : public Entry {
+    class ParameterEntry : public Group {
       friend class Factory;
       private:
-        ParameterEntry( const GTLCore::String& _name, int _minimumValue, int _maximumValue, int _defaultValue );
-        ParameterEntry( const GTLCore::String& _name, float _minimumValue, float _maximumValue, float _defaultValue );
-        ParameterEntry( const GTLCore::String& _name, const GTLCore::Value& _defaultValue );
+        ParameterEntry( const GTLCore::String& _name, const std::list< const Entry* >& _entries );
         virtual ~ParameterEntry();
       public:
         const Value& minimumValue() const;
         const Value& maximumValue() const;
         const Value& defaultValue() const;
         const Type* type() const;
+        const GTLCore::String& description() const;
       public:
         virtual const ParameterEntry* asParameterEntry() const;
       private:

Added: trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ValueEntry.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ValueEntry.cpp	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ValueEntry.cpp	2008-11-27 19:22:19 UTC (rev 504)
@@ -0,0 +1,48 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "ValueEntry.h"
+
+#include "../Value.h"
+
+using namespace GTLCore::Metadata;
+
+struct ValueEntry::Private {
+  GTLCore::Value value;
+};
+
+ValueEntry::ValueEntry( const GTLCore::String& _name, const GTLCore::Value& _value ) : Entry(_name), d(new Private)
+{
+  d->value = _value;
+}
+
+ValueEntry::~ValueEntry()
+{
+  delete d;
+}
+
+const GTLCore::Value& ValueEntry::value() const
+{
+  return d->value;
+}
+
+const ValueEntry* ValueEntry::asValueEntry() const
+{
+  return this;
+}


Property changes on: trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ValueEntry.cpp
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ValueEntry.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ValueEntry.h	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ValueEntry.h	2008-11-27 19:22:19 UTC (rev 504)
@@ -0,0 +1,42 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _GTLCORE_METADATA_VALUE_ENTRY_H_
+#define _GTLCORE_METADATA_VALUE_ENTRY_H_
+
+#include <GTLCore/Metadata/Entry.h>
+
+namespace GTLCore {
+  class Value;
+  namespace Metadata {
+    class ValueEntry : public Entry {
+        friend class Factory;
+        ValueEntry( const GTLCore::String& _name, const GTLCore::Value& _value );
+        virtual ~ValueEntry();
+      public:
+        virtual const ValueEntry* asValueEntry() const;
+        const GTLCore::Value& value() const;
+      private:
+        struct Private;
+        Private* const d;
+    };
+  }
+} 
+
+#endif


Property changes on: trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ValueEntry.h
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: trunk/OpenGTL/OpenGTL/GTLCore/tests/TestMetadata.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/tests/TestMetadata.h	2008-11-26 23:10:07 UTC (rev 503)
+++ trunk/OpenGTL/OpenGTL/GTLCore/tests/TestMetadata.h	2008-11-27 19:22:19 UTC (rev 504)
@@ -22,6 +22,7 @@
 #include "../Metadata/Group.h"
 #include "../Metadata/ParameterEntry.h"
 #include "../Metadata/TextEntry.h"
+#include "../Metadata/ValueEntry.h"
 
 class TestEntry : public GTLTest::Case {
   public:
@@ -30,7 +31,7 @@
     }
     virtual void runTest()
     {
-      Metadata::Entry* entry = Metadata::Factory::createEntry( "test");
+      const Metadata::Entry* entry = Metadata::Factory::createEntry( "test");
       GTLTEST_CHECK_EQUAL( entry->name(), "test" );
       GTLTEST_CHECK_EQUAL( entry->asGroup(), 0 );
       GTLTEST_CHECK_EQUAL( entry->asParameterEntry(), 0 );
@@ -46,7 +47,7 @@
     }
     virtual void runTest()
     {
-      Metadata::TextEntry* entry = Metadata::Factory::createTextEntry( "test", "text" );
+      const Metadata::TextEntry* entry = Metadata::Factory::createTextEntry( "test", "text" );
       GTLTEST_CHECK_EQUAL( entry->name(), "test" );
       GTLTEST_CHECK_EQUAL( entry->text(), "text" );
       GTLTEST_CHECK_EQUAL( entry->asGroup(), 0 );
@@ -63,10 +64,10 @@
     }
     virtual void runTest()
     {
-      Metadata::TextEntry* textEntry = Metadata::Factory::createTextEntry( "test", "text" );
-      std::list< Metadata::Entry* > entries;
+      const Metadata::TextEntry* textEntry = Metadata::Factory::createTextEntry( "test", "text" );
+      std::list< const Metadata::Entry* > entries;
       entries.push_back( textEntry );
-      Metadata::Group* entry = Metadata::Factory::createGroup( "testGroup", entries );
+      const Metadata::Group* entry = Metadata::Factory::createGroup( "testGroup", entries );
       GTLTEST_CHECK_EQUAL( entry->name(), "testGroup" );
       GTLTEST_CHECK_EQUAL( entry->entries().size(), 1 );
       GTLTEST_CHECK_EQUAL( *entry->entries().begin(), textEntry );
@@ -83,7 +84,7 @@
   GTLTEST_CHECK_EQUAL( entry->defaultValue().type(), entry->type() );
 
 #define TEST_PARAMETER_ENTRY(entry) \
-  GTLTEST_CHECK_EQUAL( entry->asGroup(), 0 ); \
+  GTLTEST_CHECK_EQUAL( entry->asGroup(), entry); \
   GTLTEST_CHECK_EQUAL( entry->asParameterEntry(), entry ); \
   GTLTEST_CHECK_EQUAL( entry->asTextEntry(), 0 );
 
@@ -95,7 +96,12 @@
     virtual void runTest()
     {
       {
-        Metadata::ParameterEntry* entry = Metadata::Factory::createParameterEntry( "int", -10, 20, 10 );
+        std::list< const Metadata::Entry* > entries;
+        entries.push_back( Metadata::Factory::createTextEntry( "type", "int" ) );
+        entries.push_back( Metadata::Factory::createValueEntry( "minValue", -10 ) );
+        entries.push_back( Metadata::Factory::createValueEntry( "maxValue", 20 ) );
+        entries.push_back( Metadata::Factory::createValueEntry( "defaultValue", 10 ) );
+        const Metadata::ParameterEntry* entry = Metadata::Factory::createParameterEntry( "int", entries );
         GTLTEST_CHECK_EQUAL( entry->name(), "int" );
         TEST_PARAMETER_ENTRY_CONSISTENT_TYPE(entry);
         TEST_PARAMETER_ENTRY(entry);
@@ -105,7 +111,12 @@
         GTLTEST_CHECK_EQUAL( entry->defaultValue().asInt32(), 10 );
       }
       {
-        Metadata::ParameterEntry* entry = Metadata::Factory::createParameterEntry( "float", -0.1f, 1.0f, 0.5f );
+        std::list< const Metadata::Entry* > entries;
+        entries.push_back( Metadata::Factory::createTextEntry( "type", "float" ) );
+        entries.push_back( Metadata::Factory::createValueEntry( "minValue", -0.1f ) );
+        entries.push_back( Metadata::Factory::createValueEntry( "maxValue", 1.0f ) );
+        entries.push_back( Metadata::Factory::createValueEntry( "defaultValue", 0.5f ) );
+        const Metadata::ParameterEntry* entry = Metadata::Factory::createParameterEntry( "float", entries );
         GTLTEST_CHECK_EQUAL( entry->name(), "float" );
         GTLTEST_CHECK_EQUAL( GTLCore::Type::Float, entry->type() );
         TEST_PARAMETER_ENTRY_CONSISTENT_TYPE(entry);
@@ -115,7 +126,10 @@
         GTLTEST_CHECK_EQUAL( entry->defaultValue().asFloat(), 0.5f );
       }
       {
-        Metadata::ParameterEntry* entry = Metadata::Factory::createParameterEntry( "int", GTLCore::Value( 10 ) );
+        std::list< const Metadata::Entry* > entries;
+        entries.push_back( Metadata::Factory::createTextEntry( "type", "int" ) );
+        entries.push_back( Metadata::Factory::createValueEntry( "defaultValue", 10 ) );
+        const Metadata::ParameterEntry* entry = Metadata::Factory::createParameterEntry( "int", entries );
         GTLTEST_CHECK_EQUAL( entry->name(), "int" );
         TEST_PARAMETER_ENTRY_CONSISTENT_TYPE(entry);
         TEST_PARAMETER_ENTRY(entry);
@@ -125,7 +139,10 @@
         GTLTEST_CHECK_EQUAL( entry->defaultValue().asInt32(), 10 );
       }
       {
-        Metadata::ParameterEntry* entry = Metadata::Factory::createParameterEntry( "float", GTLCore::Value( 0.5f ) );
+        std::list< const Metadata::Entry* > entries;
+        entries.push_back( Metadata::Factory::createTextEntry( "type", "float" ) );
+        entries.push_back( Metadata::Factory::createValueEntry( "defaultValue", 0.5f ) );
+        const Metadata::ParameterEntry* entry = Metadata::Factory::createParameterEntry( "float", entries);
         GTLTEST_CHECK_EQUAL( entry->name(), "float" );
         GTLTEST_CHECK_EQUAL( GTLCore::Type::Float, entry->type() );
         TEST_PARAMETER_ENTRY_CONSISTENT_TYPE(entry);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/