00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef TECPLOT_TOOLBOX_AUXDATA_H
00012 #define TECPLOT_TOOLBOX_AUXDATA_H
00013
00014 #if defined MSWIN
00015 #pragma once
00016 #endif
00017
00018 #include <string>
00019 #include "tptoolbox.h"
00020
00021 namespace tecplot
00022 {
00023 namespace toolbox
00024 {
00025
00026 class Set;
00027
00031 class TPTOOLBOX_DLLAPI AuxData
00032 {
00033 public:
00060 AuxData(const AuxDataLocation_e auxDataLocation,
00061 const EntIndex_t zoneOrMapOrVariable = 1);
00062 virtual ~AuxData();
00063
00074 virtual bool isValid() const;
00075
00082 virtual AuxData_pa getRef() const;
00083
00105 virtual bool set(std::string name,
00106 const char* value,
00107 bool retain = true) const;
00108 virtual inline bool set(std::string name,
00109 std::string value,
00110 bool retain = true) const
00111 {
00112 return set(name, value.c_str(), retain);
00113 }
00114
00140 virtual bool set(std::string name,
00141 LgIndex_t value,
00142 bool retain = true) const;
00143
00170 virtual bool set(std::string name,
00171 double value,
00172 bool retain = true) const;
00173
00200 virtual bool set(std::string name,
00201 bool value,
00202 bool retain = true) const;
00203
00229 virtual bool set(std::string name,
00230 const Set& value,
00231 bool retain = true) const;
00232
00250 template <typename T>
00251 inline bool get(std::string name,
00252 T* value,
00253 bool* retain = NULL) const
00254 {
00255 REQUIRE(VALID_NON_ZERO_LEN_STR(name.c_str()));
00256 REQUIRE(VALID_REF(value));
00257 REQUIRE(VALID_REF_OR_NULL(retain));
00258
00259
00260
00261
00262
00263
00264 LgIndex_t index;
00265 bool result = getIndex(name, &index);
00266 if (result)
00267 get(index,
00268 value,
00269 NULL,
00270 retain);
00271 return result;
00272 }
00273
00292 virtual void get(LgIndex_t index,
00293 std::string* value,
00294 std::string* name = NULL,
00295 bool* retain = NULL) const;
00296
00317 virtual void get(LgIndex_t index,
00318 LgIndex_t* value,
00319 std::string* name = NULL,
00320 bool* retain = NULL) const;
00321
00342 virtual void get(LgIndex_t index,
00343 double* value,
00344 std::string* name = NULL,
00345 bool* retain = NULL) const;
00346
00369 virtual void get(LgIndex_t index,
00370 bool* value,
00371 std::string* name = NULL,
00372 bool* retain = NULL) const;
00373
00394 virtual void get(LgIndex_t index,
00395 Set* value,
00396 std::string* name = NULL,
00397 bool* retain = NULL) const;
00398
00409 virtual void remove(LgIndex_t index) const;
00410
00424 virtual bool remove(std::string name) const;
00425
00439 virtual bool getIndex(std::string name,
00440 LgIndex_t* index) const;
00441
00448 virtual LgIndex_t size() const;
00449
00456 AuxDataLocation_e getAuxDataLocation() const
00457 {
00458 return m_auxDataLocation;
00459 }
00460
00468 EntIndex_t getZoneOrMapOrVarIndex() const
00469 {
00470 return m_zoneOrMapOrVar;
00471 }
00472
00473 private:
00474 AuxData& operator=(const AuxData&);
00475
00476 private:
00477 const AuxDataLocation_e m_auxDataLocation;
00478 const EntIndex_t m_zoneOrMapOrVar;
00479 };
00480
00481 }
00482 }
00483
00484 #endif