Public Member Functions | Static Public Member Functions | Public Attributes

FPValue Class Reference

This reference page is linked to from the following overview topics: Mesh Example, Parameter Validation, Additional ParamType2 Codes for Function Publishing and MAXScript, Added Base Types, Supported Types, Calling MAXScript from C++.


Search for all occurrences

Detailed Description

See also:
List of ParamType2 Choices, Template Class Tab.

Description:
This class is available in release 4.0 and later only.

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.

#include <ifnpub.h>

Inheritance diagram for FPValue:
Inheritance graph
[legend]

List of all members.

Public Member Functions

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

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.

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
   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
   Tab< int > *   i_tab
   Tab< float > *   f_tab
   Tab< Point3 * > *   p_tab
   Tab< Point4 * > *   p4_tab
   Tab< TimeValue > *   t_tab
   Tab< 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
}; 

Constructor & Destructor Documentation

FPValue ( ) [inline]
Remarks:
Constructor
Default Implementation:
{ Init(); }
{ 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; }
{ Init(); *this = from; }
FPValue ( int  type,
  ... 
) [inline]
Remarks:
Constructor
Default Implementation:
{va_list ap; va_start(ap, type); ap = Loadva(type, ap); va_end(ap);}
{ va_list ap; va_start(ap, type); ap = Loadva(type, ap); va_end(ap); }
CoreExport ~FPValue ( ) [inline]
Remarks:
Destructor.
Default Implementation:
{ Free(); }
{ 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  type,
int  size 
)

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

Parameters:
[in] type - 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  type,
va_list  ap,
bool  ptr = false 
)
void Load ( int  type,
  ... 
) [inline]
Remarks:
This method will load the FPValue class with the provided data.
Parameters:
int type

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);}
{ va_list ap; va_start(ap, type); ap = Loadva(type, ap); va_end(ap); }
void LoadPtr ( int  type,
  ... 
) [inline]
Remarks:
This method will load the FPValue class with the provided data.
Parameters:
int type

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); }

{ va_list ap; va_start(ap, type); ap = Loadva(type, ap, true); va_end(ap); }
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

Member Data Documentation

ParamType2 type
int i
float f
DWORD d
bool b
INT_PTR intptr
INT64 i64
double dbl
int* iptr
float* fptr
TimeValue t
MCHAR* s
Mtl* mtl
INode* n
Quat* q
Ray* ray
POINT* pt
HWND hwnd
void* ptr
Value* v
DWORD* dptr
bool* bptr
INT_PTR* intptrptr
INT64* i64ptr
double* dblptr
Tab<int>* i_tab
Tab<float>* f_tab
Tab<TimeValue>* t_tab
Tab<MCHAR*>* s_tab
Tab<POINT*>* pt_tab
Tab<HWND>* hwnd_tab
Tab<void*>* ptr_tab
Tab<DWORD>* d_tab
Tab<bool>* b_tab
Tab<INT_PTR>* intptr_tab
Tab<INT64>* i64_tab
Tab<double>* dbl_tab
union { ... }

FPValue FPValue FPValue FPValue FPValue FPValue FPValue FPValue FPValue FPValue
FPValue FPValue FPValue FPValue FPValue FPValue FPValue FPValue FPValue FPValue