Public Member Functions | Public Attributes | Protected Member Functions

FPInterfaceDesc Class Reference

This reference page is linked to from the following overview topics: Handling Requests for Interfaces, The FPInterface Class Hierarchy, Property Accessors, Symbolic Enumerations.


Search for all occurrences

Detailed Description

See also:
Class FPInterface, Class ClassDesc, Class Interface_ID, Class FPEnum, Class FPFunctionDef, Class FPPropDef, Class ActionTable, Template Class Tab, Function Publishing System.

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

This is the Function Publishing interface descriptor. This is usually a static instance of the implementation interface. The constructor for this class uses the same var-args technique used by the ParamBlockDesc2 constructor, enabling descriptive information for all the functions in the interface to be supplied in one constructor call.

The FPInterfaceDesc class, an FPInterface that contains the metadata for an interface, is a distinguished singleton instance per interface kept in a Tab<> in ClassDesc. This class is subclassed typically by static and core interfaces and instantiated by mixins to provide their metadata.

Note the following typedef: typedef FPInterfaceDesc FPStaticInterface
Data Members:
Interface_ID ID;

The unique ID of the interface.

MSTR internal_name;

The fixed internal name for the interface.

StringResID description;

The description string resource ID.

ClassDesc* cd;

Points to the publishing plug-in's ClassDesc.

USHORT flags;

The flag bits. One or more of the following values:

FP_ACTIONS

Marks this as an Action Interface, holding only UI modal, zero parameter action functions.

FP_MIXIN

Marks this as a Mixin Interface, it is implemented directly by the plug-in class, so the methods in it are virtual on the plugin's objects.

FP_CORE

Marks this as a 3ds Max Core Interface, available through GetCOREInterface(Interface_ID).

FP_STATIC_METHODS

This interface is used as a static method interface in MAXScript, properties are not directly callable

FP_SCRIPTED_CLASS

Internal use only: Belongs to a scripted plug-in class.

FP_TEMPORARY

Internal use only: Temporary descriptor built during scene load.

Tab<FPFunctionDef*> functions;

A table of descriptors for individual functions in this interface.

Tab<FPPropDef*> props;

A Table of descriptors for individual properties in this interface.

Tab<FPEnum*> enumerations;

A table of any symbolic enums for the interface. This is a Tab<> of pointers to FPEnum class instances which themselves contain a Tab<> of name, code pairs.

The following data members are for scripted plug-ins if this interface belongs to a scripted plug-in class.

MSPluginClass* pc;

The scripted class if non-NULL (gc-protected by the scripted plugin class).

Rollout* rollout;

The rollout if specified (gc-protected by the scripted plugin class).

ActionTable* action_table;

The table published for this action interface.

For more information, see Class ActionTable.

#include <ifnpub.h>

Inheritance diagram for FPInterfaceDesc:
Inheritance graph
[legend]

List of all members.

Public Member Functions

CoreExport  FPInterfaceDesc ()
CoreExport  FPInterfaceDesc (Interface_ID id, MCHAR *int_name, StringResID descr, ClassDesc *cd, ULONG flag,...)
CoreExport  ~FPInterfaceDesc ()
virtual void  Init ()
LifetimeType  LifetimeControl ()
virtual BaseInterface GetInterface (Interface_ID id)
CoreExport void  LoadDescriptor (Interface_ID id, MCHAR *int_name, StringResID descr, ClassDesc *cd, ULONG flag,...)
CoreExport void  AppendFunction (int id,...)
  Add a new function to this interface descriptor.
CoreExport void  AppendProperty (int id,...)
  Add a new property to this interface descriptor.
CoreExport void  AppendEnum (int id,...)
  Add a new enum to this interface descriptor.
CoreExport void  SetClassDesc (ClassDesc *i_cd)
CoreExport va_list  check_fn (va_list ap, int id)
CoreExport va_list  scan_fn (va_list ap, int id, int index)
CoreExport va_list  check_prop (va_list ap, int id)
CoreExport va_list  scan_prop (va_list ap, int id, int index)
CoreExport va_list  check_enum (va_list ap, EnumID id)
CoreExport va_list  scan_enum (va_list ap, EnumID id, int index)
FPInterfaceDesc GetDesc ()
Interface_ID  GetID ()
CoreExport FPFunctionDef GetFnDef (FunctionID fid)
ActionTable GetActionTable ()
CoreExport void  EnableActions (BOOL onOff)
virtual CoreExport HINSTANCE  HInstance ()
virtual CoreExport MCHAR *  GetRsrcString (StringResID id)

Public Attributes

Interface_ID  ID
MSTR  internal_name
StringResID  description
ClassDesc cd
USHORT  flags
Tab< FPFunctionDef * >  functions
Tab< FPPropDef * >  props
Tab< FPEnum * >  enumerations
MSPluginClass *  pc
Rollout *  rollout
ActionTable action_table

Protected Member Functions

CoreExport void  load_descriptor (Interface_ID id, MCHAR *int_name, StringResID descr, ClassDesc *cd, USHORT flag, va_list ap)

Constructor & Destructor Documentation

CoreExport FPInterfaceDesc ( ) [inline]
Remarks:
Constructor. No initialization is performed.
{ }
CoreExport FPInterfaceDesc ( Interface_ID  id,
MCHAR *  int_name,
StringResID  descr,
ClassDesc cd,
ULONG  flag,
  ... 
)
Remarks:
Constructor.
Parameters:
Interface_ID id

The unique ID of the interface.

MCHAR* int_name

The fixed internal name for the interface.

StringResID descr

A string resource ID containing the description for this interface class.

ClassDesc* cd

A pointer to a ClassDesc class descriptor of the publishing plug-in.

ULONG flag

The flag bits. One or more of the following values: FP_ACTIONS, FP_MIXIN, FP_CORE, FP_STATIC_METHODS, FP_SCRIPTED_CLASS, FP_TEMPORARY. For a description see the data members descriptions.

...

This constructor takes a variable number of arguments representing the 'properties' sections and function definitions. For more information see the advanced topics on Function Publishing.
CoreExport ~FPInterfaceDesc ( )

Member Function Documentation

CoreExport void load_descriptor ( Interface_ID  id,
MCHAR *  int_name,
StringResID  descr,
ClassDesc cd,
USHORT  flag,
va_list  ap 
) [protected]
virtual void Init ( ) [inline, virtual]
Remarks:
This is a virtual method called by the varargs-based constructors for interface descriptors and static interfaces, so that they have an opportunity to do runtime initialization of any extra state data you add to these interfaces (usually to static interfaces). Since such interfaces are usually constructed with the built-in varargs constructor, there is no way to do custom initialization without a hook like the Init() call. Your static interface would provide an implementation of Init() to do any special initialization.
Default Implementation:
{ }
{ }
LifetimeType LifetimeControl ( ) [inline, virtual]
Remarks:
This method allows inquiries into the actual lifetime policy of a client and provide a server-controlled delete notify callback.
Returns:
One of the following LifetimeTypes:

noRelease

Do not call release, use interface as long as you like.

immediateRelease

The interface is only good for one calls. The release is implied so a call to release is not required.

wantsRelease

The clients are controlling the lifetime, so the interface needs a Release() when the client has finished. This is the default.

serverControlled

The server controls the lifetime and will use the InterfaceNotifyCallback to inform the code when it is gone.
Default Implementation:
{ return noRelease; }

Reimplemented from BaseInterface.

{ return noRelease; }
virtual BaseInterface* GetInterface ( Interface_ID  id ) [inline, virtual]
Remarks:
Returns a pointer to the interface whose ID is specified.
Parameters:
Interface_ID id

The ID of the interface to return.
Default Implementation:
{ return NULL; }

Reimplemented from FPInterface.

Reimplemented in Interface.

{ if (id == FPINTERFACEDESC_ID) return this; else return FPInterface::GetInterface(id); }
CoreExport void LoadDescriptor ( Interface_ID  id,
MCHAR *  int_name,
StringResID  descr,
ClassDesc cd,
ULONG  flag,
  ... 
)
Remarks:
This method relates to Init(). In some cases, you really do need to provide your own constructor or set of constructors for a static interface or descriptor, but you still want to be able to load it with all the interface metadata that the built-in varargs constructor does. You can do this by calling the LoadDescriptor() method at any point in your own constructors and it takes the same arguments as the built-in varargs constructor.
Parameters:
Interface_ID id

The unique ID of the interface.

MCHAR* int_name

The fixed internal name for the interface.

StringResID descr

A string resource ID containing the description for this interface class.

ClassDesc* cd

A pointer to a ClassDesc class descriptor of the publishing plug-in.

ULONG flag

The flag bits. One or more of the following values: FP_ACTIONS, FP_MIXIN, FP_CORE, FP_STATIC_METHODS, FP_SCRIPTED_CLASS, FP_TEMPORARY. For a description see the data members descriptions.

...

This method takes a variable number of arguments representing the 'properties' sections and function definitions. For more information see the advanced topics on Function Publishing.
CoreExport void AppendFunction ( int  id,
  ... 
)

Add a new function to this interface descriptor.

Uses the same parameter syntax as LoadDescriptor and the Constructor. Note that it is mandatory to mark the end of the variable arguments list with end. Failure to do so will result in undefined behaviour.

CoreExport void AppendProperty ( int  id,
  ... 
)

Add a new property to this interface descriptor.

Uses the same parameter syntax as LoadDescriptor and the Constructor. Note that it is mandatory to mark the end of the variable arguments list with end. Failure to do so will result in undefined behaviour.

CoreExport void AppendEnum ( int  id,
  ... 
)

Add a new enum to this interface descriptor.

Uses the same parameter syntax as LoadDescriptor and the Constructor. Note that it is mandatory to mark the end of the variable arguments list with end. Failure to do so will result in undefined behaviour.

CoreExport void SetClassDesc ( ClassDesc i_cd )
Remarks:
This method sets the ClassDesc pointer associated FPInterfaceDesc class. You can only call this method once on a descriptor and then only if it has been constructed initially with a NULL cd. See the notes in the constructor.

Parameters:
ClassDesc* i_cd

This points to the ClassDesc class descriptor to set.
CoreExport va_list check_fn ( va_list  ap,
int  id 
)
Remarks:
This is used internally.
CoreExport va_list scan_fn ( va_list  ap,
int  id,
int  index 
)
Remarks:
This is used internally.
CoreExport va_list check_prop ( va_list  ap,
int  id 
)
Remarks:
This is used internally.
CoreExport va_list scan_prop ( va_list  ap,
int  id,
int  index 
)
Remarks:
This is used internally.
CoreExport va_list check_enum ( va_list  ap,
EnumID  id 
)
Remarks:
This is used internally.
CoreExport va_list scan_enum ( va_list  ap,
EnumID  id,
int  index 
)
Remarks:
This is used internally.
FPInterfaceDesc* GetDesc ( ) [inline, virtual]
Remarks:
This method returns a pointer to the descriptor for this Function Publishing interface descriptor.
Default Implementation:
{ return this; }

Implements FPInterface.

{ return this; }
Interface_ID GetID ( ) [inline, virtual]
Remarks:
This method returns the unique interface ID.

Reimplemented from BaseInterface.

{ return ID; }
CoreExport FPFunctionDef* GetFnDef ( FunctionID  fid )
Remarks:
This method returns a pointer to the function definition of a specific function identified by its ID. Calls to this method, given an FPInterface*, can be made indirectly through FPInterface::GetDesc(). For example; FPFunctionDef* fd = fpi->GetDesc()->GetFnDef(foo_move);
Parameters:
FunctionID fid

The unique function ID used to identify the function.
ActionTable* GetActionTable ( ) [inline, virtual]
Remarks:
This method returns a pointer to the action table.
Default Implementation:
{ return action_table; }

Reimplemented from FPInterface.

{ return action_table; }
CoreExport void EnableActions ( BOOL  onOff ) [virtual]
Remarks:
This method allows you to enable or disable the entire set of actions in the interface You might want to use this method if the actions are only to be active during certain periods in the running of 3ds Max. Usually, this control is achieved via ActionTable contexts.
Parameters:
BOOL onOff;

TRUE to enable actions, FALSE to disable actions.

Reimplemented from FPInterface.

virtual CoreExport HINSTANCE HInstance ( ) [virtual]
Remarks:
This method will return a handle to the owning instance.

Reimplemented in MSPluginDesc.

virtual CoreExport MCHAR* GetRsrcString ( StringResID  id ) [virtual]
Remarks:
This method returns the string associated with a specified String Resource ID
Parameters:
StringResD id

The string resource ID for which you want to obtain the string.

Reimplemented in MSPluginDesc.


Member Data Documentation

StringResID description
USHORT flags
MSPluginClass* pc
Rollout* rollout

FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc
FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc FPInterfaceDesc