00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Side Effects Software Inc 00008 * 123 Front Street West, Suite 1401 00009 * Toronto, Ontario 00010 * Canada M5J 2M2 00011 * 416-504-9876 00012 * 00013 * NAME: CVEX_ValueList.h ( CVEX Library, C++) 00014 * 00015 * COMMENTS: C++ interface to VEX. This class is used to specify 00016 * a list of input/output values 00017 */ 00018 00019 #ifndef __CVEX_ValueList__ 00020 #define __CVEX_ValueList__ 00021 00022 #include "CVEX_API.h" 00023 #include "CVEX_Value.h" 00024 #include <UT/UT_PtrArray.h> 00025 #include <UT/UT_SymbolTable.h> 00026 00027 class CVEX_API CVEX_ValueList { 00028 public: 00029 CVEX_ValueList(); 00030 ~CVEX_ValueList(); 00031 00032 // Returns the number of values in the list 00033 int entries() { return myValues.entries(); } 00034 00035 // Get a value by index or by name 00036 CVEX_Value *getValue(int i) { return myValues(i); } 00037 CVEX_Value *getValue(const char *name, CVEX_Type type); 00038 00039 // Add a value. This fails if: 00040 // - There's already a symbol with the name 00041 // - The type is invalid 00042 bool addValue(const char *name, CVEX_Type type, bool varying); 00043 bool addValue(const char *name, CVEX_Type type, 00044 void *data, int array_size); 00045 bool addValue(const char *name, UT_StringArray &strings); 00046 00047 private: 00048 void clear(); 00049 void addValue(CVEX_Value *value); 00050 00051 UT_SymbolTable mySymbols; 00052 UT_PtrArray<CVEX_Value *> myValues; 00053 00054 friend class CVEX_Context; 00055 }; 00056 00057 #endif
1.5.9