• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

MLAPI_BaseObject.h

Go to the documentation of this file.
00001 #ifndef MLAPI_BASEOBJECT_H
00002 #define MLAPI_BASEOBJECT_H
00003 
00013 /* ******************************************************************** */
00014 /* See the file COPYRIGHT for a complete copyright notice, contact      */
00015 /* person and disclaimer.                                               */        
00016 /* ******************************************************************** */
00017 
00018 #include <iostream>
00019 #include "MLAPI_Workspace.h"
00020 
00021 namespace MLAPI {
00022 
00035 class BaseObject {
00036 
00037 public:
00039   BaseObject() 
00040   {
00041     Label_ = "obj_" + GetString(count_);
00042     ++count_;
00043   }
00044 
00046   BaseObject(const string& Label)
00047   {
00048     Label_ = Label;
00049   }
00050 
00052   virtual ~BaseObject() {};
00053 
00055   void SetLabel(const string& Label)
00056   {
00057     Label_ = Label;
00058   }
00059 
00061   const string& GetLabel() const
00062   {
00063     return(Label_);
00064   }
00065 
00067   virtual std::ostream& Print(std::ostream& os, 
00068                               const bool Verbose = true) const = 0;
00069 
00070 private:
00072   string Label_;
00073 
00074   static int count_;
00075 };
00076 
00077 #ifdef HAVE_ML_MLAPI
00078 std::ostream& operator<< (std::ostream& os, const BaseObject& obj);
00079 #endif
00080 
00081 } // namespace MLAPI
00082 
00083 #endif