Class BaseInterface

3DS Max Plug-In SDK

Class BaseInterface

See Also: Class InterfaceServer, Class InterfaceNotifyCallback, Class FPInterface, Function Publishing System.

class BaseInterface : public InterfaceServer

Description:

This class is available in release 4.0 and later only.

This class represents the base class for interfaces in 3ds max. The BaseInterface class should be used as the base class for any new interface class in 3ds max and provides basic identity, memory management, and cloning methods. Class FPInterface, which is part of the Function Publishing system, has the BaseInterface class as its base class.

Methods:

public:

Prototype:

virtual Interface_ID GetID() = 0;

Remarks:

This method returns the unique interface ID.

Prototype:

virtual LifetimeType LifetimeControl()

Remarks:

This method allows enquiries into the actual lifetime policy of a client and provide a server-controlled delete notify callback.

Return Value:

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

Prototype:

virtual void RegisterNotifyCallback(InterfaceNotifyCallback<BaseInterface>* incb);

Remarks:

This method allows you to register an interface notify callback.

Parameters:

InterfaceNotifyCallback<BaseInterface>* incb

A pointer to the interface notify callback.

Default Implementation:

{ }

Prototype:

virtual void UnRegisterNotifyCallback(InterfaceNotifyCallback<BaseInterface>* incb);

Remarks:

This method allows you to un-register an interface notify callback.

Parameters:

InterfaceNotifyCallback<BaseInterface>* incb

A pointer to the interface notify callback.

Default Implementation:

{ }

Prototype:

virtual bool Acquire(InterfaceNotifyCallback* incb=NULL);

Remarks:

This method is part of the interface reference management and can be implemented by dynamically allocated interfaces for ref-count based lifetime control). This method should return TRUE if it needs Release() to be called.

Parameters:

InterfaceNotifyCallback* incb

A pointer to an InterfaceNotifyCallback class which will be used to signal deletion (usually a mixin).

Default Implementation:

{ return false; }

Prototype:

virtual void Release(InterfaceNotifyCallback* incb=NULL);

Remarks:

This method is called when a reference to this object is deleted.

Parameters:

InterfaceNotifyCallback* incb

A pointer to an InterfaceNotifyCallback class which will be used to signal deletion (usually a mixin).

Default Implementation:

{ }

Prototype:

virtual void DeleteInterface();

Remarks:

This method can be used as a direct interface delete request.

Default Implementation:

{ }

Prototype:

virtual BaseInterface* CloneInterface(void* remapDir = NULL);

Remarks:

This method allows you to clone the base interface.

Parameters:

void* remapDir

The RemapDir passed to the clone method.

Default Implementation:

{ return NULL; }