VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Common/Core/vtkInformationObjectBaseVectorKey.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkInformationObjectBaseVectorKey.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00024 #ifndef vtkInformationObjectBaseVectorKey_h
00025 #define vtkInformationObjectBaseVectorKey_h
00026 
00027 #include "vtkCommonCoreModule.h" // For export macro
00028 #include "vtkInformationKey.h"
00029 #include "vtkCommonInformationKeyManager.h" // Manage instances of this type.
00030 
00031 class vtkInformationObjectBaseVectorValue;
00032 
00033 class VTKCOMMONCORE_EXPORT vtkInformationObjectBaseVectorKey : public vtkInformationKey
00034 {
00035 public:
00036   vtkTypeMacro(vtkInformationObjectBaseVectorKey,vtkInformationKey);
00037   void PrintSelf(ostream& os, vtkIndent indent);
00039 
00045   vtkInformationObjectBaseVectorKey(const char* name,
00046                                     const char* location,
00047                                     const char* requiredClass=0);
00048   //
00049   ~vtkInformationObjectBaseVectorKey();
00051 
00053 
00058   static vtkInformationObjectBaseVectorKey* MakeKey(const char* name, const char* location,
00059                                              const char* requiredClass=0)
00060     {
00061     return new vtkInformationObjectBaseVectorKey(name, location, requiredClass);
00062     }
00064 
00066   void Clear(vtkInformation* info);
00069   void Resize(vtkInformation* info, int n);
00071 
00072   int Size(vtkInformation* info);
00073   int Length(vtkInformation* info){ return this->Size(info); }
00075 
00076   void Append(vtkInformation* info, vtkObjectBase *value);
00078   void Set(vtkInformation* info, vtkObjectBase *value, int i);
00080 
00083   void SetRange(vtkInformation* info,
00084                 vtkObjectBase **source,
00085                 int from,
00086                 int to,
00087                 int n);
00089 
00091 
00094   void GetRange(vtkInformation *info,
00095                 vtkObjectBase **dest,
00096                 int from,
00097                 int to,
00098                 int n);
00100 
00102   vtkObjectBase *Get(vtkInformation* info, int idx);
00103 
00104   // _escription:
00105   // Get a pointer to the first vtkObjectBase in the vector. We are
00106   // uysing a vector of smart pointers so this is not easy to
00107   // implement.
00108   // vtkObjectBase **Get(vtkInformation* info);
00109 
00113   virtual void ShallowCopy(vtkInformation* from, vtkInformation* to);
00114 
00116   virtual void Print(ostream& os, vtkInformation* info);
00117 
00118 protected:
00119   // The type required of all objects stored with this key.
00120   const char* RequiredClass;
00121 
00122 private:
00125   void CreateObjectBase();
00128   bool ValidateDerivedType(vtkInformation* info,vtkObjectBase* aValue);
00131   vtkInformationObjectBaseVectorValue *GetObjectBaseVector(vtkInformation *info);
00132 
00133   //
00134   vtkInformationObjectBaseVectorKey(const vtkInformationObjectBaseVectorKey&);  // Not implemented.
00135   void operator=(const vtkInformationObjectBaseVectorKey&);  // Not implemented.
00136 };
00137 
00138 #endif