implement operator << for ObjectFactory.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Fri, 11 Apr 2008 11:27:09 -0700
changeset 2952 d5047d6ce4ce
parent 2951 2a3db8645225
child 2953 db884a56c5c1
implement operator << for ObjectFactory.
src/core/object-factory.cc
src/core/object-factory.h
--- a/src/core/object-factory.cc	Fri Apr 11 11:25:44 2008 -0700
+++ b/src/core/object-factory.cc	Fri Apr 11 11:27:09 2008 -0700
@@ -70,7 +70,7 @@
 
 std::ostream & operator << (std::ostream &os, const ObjectFactory &factory)
 {
-  // XXX
+  os << factory.m_tid.GetName () << "[" << factory.m_parameters.SerializeToString () << "]";
   return os;
 }
 std::istream & operator >> (std::istream &is, ObjectFactory &factory)
--- a/src/core/object-factory.h	Fri Apr 11 11:25:44 2008 -0700
+++ b/src/core/object-factory.h	Fri Apr 11 11:27:09 2008 -0700
@@ -76,6 +76,9 @@
 
   ATTRIBUTE_HELPER_HEADER_1 (ObjectFactory);
 private:
+  friend std::ostream & operator << (std::ostream &os, const ObjectFactory &factory);
+  friend std::istream & operator >> (std::istream &is, ObjectFactory &factory);
+
   TypeId m_tid;
   AttributeList m_parameters;
 };