00001 // ***************************************************************************** 00002 // ***************************************************************************** 00003 // sdBase.h 00004 // 00005 // This file contains the following class definitions. 00006 // 00007 // sdObjectType 00008 // This is the wrapper class for sdObjectTypeEnum. sdObjectTypeEnum 00009 // defines the different types of sd objects that can be created. 00010 // 00011 // sdBase 00012 // This class is the base class for schema definition classes that 00013 // collectively define the schema of a system. 00014 // 00015 // ***************************************************************************** 00016 // Except as specified in the OpenAccess terms of use of Cadence or Silicon 00017 // Integration Initiative, this material may not be copied, modified, 00018 // re-published, uploaded, executed, or distributed in any way, in any medium, 00019 // in whole or in part, without prior written permission from Cadence. 00020 // 00021 // Copyright 2007 Cadence Design Systems, Inc. 00022 // All Rights Reserved. 00023 // 00024 // $Author: icftcm $ 00025 // $Revision: #1 $ 00026 // $Date: 2007/03/20 $ 00027 // $State: Exp $ 00028 // ***************************************************************************** 00029 // ***************************************************************************** 00030 00031 00032 00033 #if !defined(sdBase_P) 00034 #define sdBase_P 00035 00036 00037 00038 // ***************************************************************************** 00039 // Nested includes 00040 // ***************************************************************************** 00041 #include "sdBaseTypes.h" 00042 00043 00044 00045 // ***************************************************************************** 00046 // Declare and define types in the schema definition namespace. 00047 // ***************************************************************************** 00048 BEGIN_SD_NAMESPACE 00049 00050 00051 00052 // ***************************************************************************** 00053 // Forward Public Class Declarations 00054 // ***************************************************************************** 00055 class sdNameSpace; 00056 class sdVisitor; 00057 00058 00059 00060 // ***************************************************************************** 00061 // sdObjectTypeEnum 00062 // ***************************************************************************** 00063 #define sdvNumObjectTypes 4 00064 00065 enum sdObjectTypeEnum { 00066 sdcValueObjectType = 0, 00067 sdcAttributeObjectType = 1, 00068 sdcRelationshipObjectType = 2, 00069 sdcObjectObjectType = 3 00070 }; 00071 00072 00073 00074 // ***************************************************************************** 00075 // sdObjectType 00076 // ***************************************************************************** 00077 class SD_DLL_API sdObjectType { 00078 public: 00079 sdObjectType(sdObjectTypeEnum valueType); 00080 sdObjectType(const std::string &name); 00081 ~sdObjectType(); 00082 00083 const std::string &getName() const; 00084 operator sdObjectTypeEnum() const; 00085 00086 private: 00087 static const std::string *initNames(); 00088 00089 sdObjectTypeEnum m_value; 00090 00091 static const std::string *s_names; 00092 }; 00093 00094 00095 00096 // ***************************************************************************** 00097 // sdBase 00098 // ***************************************************************************** 00099 class SD_DLL_API sdBase { 00100 public: 00101 virtual ~sdBase(); 00102 00103 sdObjectType getObjectType() const; 00104 const sdNameSpace *getNameSpace() const; 00105 00106 virtual void accept(sdVisitor *visitor) = 0; 00107 00108 protected: 00109 sdBase(sdObjectType objectType, 00110 sdNameSpace *nameSpace); 00111 private: 00112 const sdObjectType m_objectType; 00113 const sdNameSpace *m_nameSpace; 00114 }; 00115 00116 00117 00118 END_SD_NAMESPACE 00119 00120 #endif
Copyright © 2002 - 2010 Cadence Design Systems, Inc.
All Rights Reserved.