- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Utils/Lang/Object.h

    00001
    00002 //
    00003 // Copyright (c) 2004           Model-based Embedded and Robotic Systems Group
    00004 // All Rights Reserved          Massachusetts Institute of Technology
    00005 //
    00006 // This software is provided as is. Model-based Embedded and Robotic Systems
    00007 // (MERS) group does not assume any responsibility.
    00008 //
    00009 // Organization:        Model-based Embedded and Robotic Systems Group
    00010 //                                      Massachusetts Institute of Technology
    00011 //
    00013
    00014 #if !defined(AFX_OBJECT_H__C80B7BAF_86CD_4A79_A7AB_54E6B88728EF__INCLUDED_)
    00015 #define AFX_OBJECT_H__C80B7BAF_86CD_4A79_A7AB_54E6B88728EF__INCLUDED_
    00016
    00017 #if _MSC_VER > 1000
    00018 #pragma once
    00019 #endif // _MSC_VER > 1000
    00020
    00021 #ifndef EMBEDDED
    00022 #include <iostream>
    00023 #else
    00024 #ifndef NULL
    00025 #define NULL 0
    00026 #endif
    00027 #endif
    00028
    00037 #ifdef FAILED
    00038 #undef FAILED
    00039 #endif
    00040
    00041 #ifdef WARNINGS_AS_ERRORS
    00042 //inline bool FAILED(unsigned int expression) { return ((expression) != 0); }
    00043 //inline bool FAILED(int expression) { return ((expression) != 0); }
    00044 #else
    00045 //inline bool FAILED(unsigned int expression) { return ((expression) > 0); }
    00046 //inline bool FAILED(int expression) { return ((expression) > 0); }
    00047 #endif
    00048
    00052 #ifndef EMBEDDED
    00053 #define ConditionalDebugOut(condition, code) if(condition) { code }
    00054 #define DebugOut(code) { code }
    00055 #else
    00056 #define ConditionalDebugOut(condition, code)
    00057 #define DebugOut(code)
    00058 #endif
    00059
    00060 //for us linux people who don't have strcmp just lying around
    00061 #include <string.h>
    00062
    00063 namespace Mers {
    00064         namespace Utils {
    00065                 namespace Lang {
    00066
    00077                         class Object
    00078                         {
    00079                         public:
    00089                                 enum ObjectType {Unknown = -1, BMAssignment = 0, BMClause = 1,
    00090                                                                                                  BMSentence = 2,  BMDomain = 3, BMVariable = 4, BMValue = 5,
    00091                                                                                                  BMVector = 6, BMModel = 7, oHCAAutomaton = 8, oHCATimeConstraint = 9,
    00092                                                                                                  oHCATransition = 10, oMarkedAutomaton = 11, oHCAFunctionCall = 12,
    00093                                                                                                  oGIState = 13, oGIEntry = 14, oGoalInterpreter = 15, oString = 16,
    00094                                                                                                  oRTAPIMessage = 17, oCommandCallback = 18, oCCAAutomaton = 19,
    00095                                                                                                  oCCAState = 20, oCCATransition = 21, oHaDMoReDependencyHyperedge = 22,
    00096                                                                                                  oHaDMoReDependencyNode = 23, oDispatcherPair = 24};
    00097
    00098                                 //-----------------------------------------
    00099                                 // Construction/Destruction
    00100                                 //-----------------------------------------
    00101
    00107                                 Object(ObjectType myType = Unknown);
    00108
    00109                                 // Default copy constructor used
    00110                                 // Object(Object const &other);
    00111
    00117                                 virtual ~Object();
    00118
    00119                                 //-----------------------------------------
    00120                                 // Functions
    00121                                 //-----------------------------------------
    00122
    00129                                 static char const * objectTypeToString(ObjectType objType);
    00130
    00131                                 // This would be potentially useful for debugging purposes:
    00132                                 // virtual const char* getClassName() = 0;
    00133
    00139                                 ObjectType getObjectType() const;
    00140
    00151                                 virtual Object* duplicate() const;
    00152
    00153 #ifndef EMBEDDED
    00154
    00159                                 virtual void print(std::ostream &out) const = 0;
    00160
    00161 #endif
    00162
    00163                         private:
    00168                                 Object& operator=(const Object&);
    00169
    00170                                 //-----------------------------------------
    00171                                 // Data
    00172                                 //-----------------------------------------
    00173
    00175                                 ObjectType const objectType;
    00176
    00177                         };
    00178
    00179 #ifndef EMBEDDED
    00180
    00186                         std::ostream & operator <<(std::ostream &out, Object const& other);
    00187
    00194                         std::ostream & operator <<(std::ostream &out, Object const* other);
    00195 #endif
    00196                 }
    00197         }
    00198 }
    00199
    00200 #endif // !defined(AFX_BASEMODELOBJECT_H__C80B7BAF_86CD_4A79_A7AB_54E6B88728EF__INCLUDED_)