FPValue Class Reference

#include <ifnpub.h>

Class Description

See also
ParamType, ParamType2, Template Class Tab.

Description:
This class contains a single value used as part of the Function Publishing system. It's capable of holding any of the FnPub supported types. This value is used as a parameter and as a return value.
Data Members:
ParamType2 type;

This data member identifies which type of value is stored in the union below.

The following union contains a single value, pointer to a single value, or a pointer to a single table (Tab<>) of values.

+ Inheritance diagram for FPValue:

Public Member Functions

 FPValue ()
 
 FPValue (const FPValue &from)
 
 FPValue (int type,...)
 
CoreExport ~FPValue ()
 
CoreExport void Free ()
 
CoreExport void Init ()
 
CoreExport void InitTab (ParamType2 paramType, int size)
 Allocates and initializes the Tab in the FPValue for TAB types. More...
 
CoreExport FPValueoperator= (const FPValue &sv)
 
CoreExport va_list Loadva (int iType, va_list ap, bool pointer=false)
 
void Load (int paramType,...)
 
void LoadPtr (int paramType,...)
 
CoreExport IOResult Save (ISave *isave)
 Saves the FPValue. More...
 
CoreExport IOResult Load (ILoad *iload)
 Loads the FPValue. More...
 
CoreExport bool operator== (const FPValue &val) const
 

Static Public Member Functions

static CoreExport bool IsPointerBasedType (ParamType2 type)
 Returns true if the data associated with the type is represented by a pointer. If the type is a TAB type, whether the data in the Tab is represented by a pointer. More...
 
- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 

Public Attributes

ParamType2 type
 
union {
   int   i
 
   float   f
 
   DWORD   d
 
   bool   b
 
   INT_PTR   intptr
 
   INT64   i64
 
   double   dbl
 
   int *   iptr
 
   float *   fptr
 
   Point3 *   p
 
   Point4 *   p4
 
   TimeValue   t
 
   const MCHAR *   s
 
   MSTR *   tstr
 
   PBBitmap *   bm
 
   Mtl *   mtl
 
   Texmap *   tex
 
   INode *   n
 
   ReferenceTarget *   r
 
   Matrix3 *   m
 
   AngAxis *   aa
 
   Quat *   q
 
   Ray *   ray
 
   Point2 *   p2
 
   BitArray *   bits
 
   ClassDesc *   cd
 
   Mesh *   msh
 
   Object *   obj
 
   Control *   ctrl
 
   Interval *   intvl
 
   POINT *   pt
 
   HWND   hwnd
 
   IObject *   iobj
 
   FPInterface *   fpi
 
   void *   ptr
 
   Color *   clr
 
   AColor *   aclr
 
   FPValue *   fpv
 
   Value *   v
 
   DWORD *   dptr
 
   bool *   bptr
 
   INT_PTR *   intptrptr
 
   INT64 *   i64ptr
 
   double *   dblptr
 
   Box3 *   b3
 
   BezierShape *   bezshape
 
   Tab< int > *   i_tab
 
   Tab< float > *   f_tab
 
   Tab< Point3 * > *   p_tab
 
   Tab< Point4 * > *   p4_tab
 
   Tab< TimeValue > *   t_tab
 
   Tab< const MCHAR * > *   s_tab
 
   Tab< MSTR * > *   tstr_tab
 
   Tab< PBBitmap * > *   bm_tab
 
   Tab< Mtl * > *   mtl_tab
 
   Tab< Texmap * > *   tex_tab
 
   Tab< INode * > *   n_tab
 
   Tab< ReferenceTarget * > *   r_tab
 
   Tab< Matrix3 * > *   m3_tab
 
   Tab< AngAxis * > *   aa_tab
 
   Tab< Quat * > *   q_tab
 
   Tab< Ray * > *   ray_tab
 
   Tab< Point2 * > *   p2_tab
 
   Tab< BitArray * > *   bits_tab
 
   Tab< ClassDesc * > *   cd_tab
 
   Tab< Mesh * > *   msh_tab
 
   Tab< Object * > *   obj_tab
 
   Tab< Control * > *   ctrl_tab
 
   Tab< Interval * > *   intvl_tab
 
   Tab< POINT * > *   pt_tab
 
   Tab< HWND > *   hwnd_tab
 
   Tab< IObject * > *   iobj_tab
 
   Tab< FPInterface * > *   fpi_tab
 
   Tab< void * > *   ptr_tab
 
   Tab< Color * > *   clr_tab
 
   Tab< AColor * > *   aclr_tab
 
   Tab< FPValue * > *   fpv_tab
 
   Tab< Value * > *   v_tab
 
   Tab< DWORD > *   d_tab
 
   Tab< bool > *   b_tab
 
   Tab< INT_PTR > *   intptr_tab
 
   Tab< INT64 > *   i64_tab
 
   Tab< double > *   dbl_tab
 
   Tab< Box3 * > *   b3_tab
 
   Tab< BezierShape * > *   bezshape_tab
 
}; 
 

Constructor & Destructor Documentation

FPValue ( )
inline
Remarks
Constructor
Default Implementation:
{ Init(); }
1264 { Init(); }
CoreExport void Init()
FPValue ( const FPValue from)
inline
Remarks
Copy Constructor.
Parameters:
FPValue& from

A reference to a FPValue to copy from.
Default Implementation:
{ Init(); *this = from; }
1272 { Init(); *this = from; }
CoreExport void Init()
FPValue ( int  type,
  ... 
)
inline
Remarks
Constructor
Default Implementation:
{va_list ap; va_start(ap, type); ap = Loadva(type, ap); va_end(ap);}
1278 { va_list ap; va_start(ap, type); ap = Loadva(type, ap); va_end(ap); }
CoreExport va_list Loadva(int iType, va_list ap, bool pointer=false)
ParamType2 type
Definition: ifnpub.h:1166
CoreExport ~FPValue ( )
inline
Remarks
Destructor.
Default Implementation:
{ Free(); }
1283 { Free(); }
CoreExport void Free()

Member Function Documentation

CoreExport void Free ( )
Remarks
This method will free up all memory used by the class.

CoreExport void Init ( )
Remarks
This method will Initialize FPValue class.
Default Implementation:
{ type = (ParamType2)TYPE_INT; s = NULL; }
CoreExport void InitTab ( ParamType2  paramType,
int  size 
)

Allocates and initializes the Tab in the FPValue for TAB types.

Parameters
[in]paramType- The ParamType2 type to set the FPValue to.
[in]size- The size of the tab
CoreExport FPValue& operator= ( const FPValue sv)
Remarks
Assignment operator.
CoreExport va_list Loadva ( int  iType,
va_list  ap,
bool  pointer = false 
)
void Load ( int  paramType,
  ... 
)
inline
Remarks
This method will load the FPValue class with the provided data.
Parameters:
int paramType

The FPValue parameter type to load.

...

This method takes a variable number of arguments.
Default Implementation:
{va_list ap; va_start(ap, type); ap = Loadva(type, ap); va_end(ap);}
1313 { va_list ap; va_start(ap, paramType); ap = Loadva(paramType, ap); va_end(ap); }
CoreExport va_list Loadva(int iType, va_list ap, bool pointer=false)
void LoadPtr ( int  paramType,
  ... 
)
inline
Remarks
This method will load the FPValue class with the provided data.
Parameters:
int paramType

The FPValue parameter type to load.

...

This method takes a variable number of arguments.
Returns
{ va_list ap; va_start(ap, type);

ap = Loadva(type, ap, true); va_end(ap); }

1324 { va_list ap; va_start(ap, paramType); ap = Loadva(paramType, ap, true); va_end(ap); }
CoreExport va_list Loadva(int iType, va_list ap, bool pointer=false)
CoreExport IOResult Save ( ISave isave)

Saves the FPValue.

Note that raw pointers are not saved. FPValues that contain a raw pointer (TYPE_IOBJECT, TYPE_INTERFACE, TYPE_VOID, TYPE_HWND) will store a pointer value of NULL.

For TYPE_VALUE values, only the following singleton values are saved and loaded: undefined, unsupplied, emptyVal, ok.

All other value types are saved as undefined.

Parameters
[in]isave- This class provides methods to save data to disk.
Returns
IOResult - One of the following values: IO_OK - The result was acceptable - no errors. IO_ERROR - This is returned if an error occurred.
\remarks Saves the FPValue. Note that raw pointers are not saved.
FPValues that contain a raw pointer (TYPE_IOBJECT, TYPE_INTERFACE, TYPE_VOID, TYPE_HWND) will store a pointer value of NULL. For TYPE_VALUE values, only the following singleton values are saved and loaded: undefined, unsupplied, emptyVal, ok. All other value types are saved as undefined.
Parameters:
isave

This class provides methods to save data to disk.
See also
ISave
Returns
IOResult - One of the following values:

IO_OK - The result was acceptable - no errors.

IO_ERROR - This is returned if an error occurred.

CoreExport IOResult Load ( ILoad iload)

Loads the FPValue.

Parameters
[in]iload- This class provides methods to load data from disk.
Returns
IOResult - One of the following values: IO_OK - The result was acceptable - no errors. IO_ERROR - This is returned if an error occurred.
static CoreExport bool IsPointerBasedType ( ParamType2  type)
static

Returns true if the data associated with the type is represented by a pointer. If the type is a TAB type, whether the data in the Tab is represented by a pointer.

Parameters
[in]type- The ParamType2 type to test.
Returns
bool - True if the FPValue's data, or the Tab's data if a TAB type, is a pointer
CoreExport bool operator== ( const FPValue val) const
Remarks
Compares this class instance to another one

Member Data Documentation

ParamType2 type
int i
float f
DWORD d
bool b
INT_PTR intptr
INT64 i64
double dbl
int* iptr
float* fptr
Point3* p
Point4* p4
const MCHAR* s
MSTR* tstr
PBBitmap* bm
Mtl* mtl
Texmap* tex
INode* n
Matrix3* m
AngAxis* aa
Quat* q
Ray* ray
Point2* p2
BitArray* bits
ClassDesc* cd
Mesh* msh
Object* obj
Control* ctrl
Interval* intvl
POINT* pt
HWND hwnd
IObject* iobj
void* ptr
Color* clr
AColor* aclr
FPValue* fpv
Value* v
DWORD* dptr
bool* bptr
INT_PTR* intptrptr
INT64* i64ptr
double* dblptr
Box3* b3
BezierShape* bezshape
Tab<int>* i_tab
Tab<float>* f_tab
Tab<Point3*>* p_tab
Tab<Point4*>* p4_tab
Tab<TimeValue>* t_tab
Tab<const MCHAR*>* s_tab
Tab<MSTR*>* tstr_tab
Tab<PBBitmap*>* bm_tab
Tab<Mtl*>* mtl_tab
Tab<Texmap*>* tex_tab
Tab<INode*>* n_tab
Tab<ReferenceTarget*>* r_tab
Tab<Matrix3*>* m3_tab
Tab<AngAxis*>* aa_tab
Tab<Quat*>* q_tab
Tab<Ray*>* ray_tab
Tab<Point2*>* p2_tab
Tab<BitArray*>* bits_tab
Tab<ClassDesc*>* cd_tab
Tab<Mesh*>* msh_tab
Tab<Object*>* obj_tab
Tab<Control*>* ctrl_tab
Tab<Interval*>* intvl_tab
Tab<POINT*>* pt_tab
Tab<HWND>* hwnd_tab
Tab<IObject*>* iobj_tab
Tab<FPInterface*>* fpi_tab
Tab<void*>* ptr_tab
Tab<Color*>* clr_tab
Tab<AColor*>* aclr_tab
Tab<FPValue*>* fpv_tab
Tab<Value*>* v_tab
Tab<DWORD>* d_tab
Tab<bool>* b_tab
Tab<INT_PTR>* intptr_tab
Tab<INT64>* i64_tab
Tab<double>* dbl_tab
Tab<Box3*>* b3_tab
Tab<BezierShape*>* bezshape_tab
union { ... }