filter (lx_filter.hpp)

From The Foundry MODO SDK wiki
(Redirected from ILxCacheData (index))
Jump to: navigation, search
There are security restrictions on this page


Evaluation Stack Interface

(1) SDK: ILxEvaluationStack interface
         LXxMETHOD( const char *,
 Type) (
         LXtObjectID              self);
 
         LXxMETHOD( LxResult,
 Branch) (
         LXtObjectID              self,
         void                   **ppvObj);
 
         LXxMETHOD( LxResult,
 AddFilter) (
         LXtObjectID              self,
         LXtObjectID              filter);

(2) SDK: Declarations
 #define LXu_EVALUATIONSTACK     "47F3BF05-B64A-49D9-A2C1-08B0D36AB787"

(3) User Class: EvaluationStack method
         bool
 MakeBranch (
         CLxLoc_EvaluationStack  &branch)
 {
         LXtObjectID              obj;
 
         if (LXx_FAIL (Branch (&obj)))
                 return false;
 
         return branch.take (obj);
 }

Empty EvaluationStack Python user class.

(4) PY: EvaluationStack method
 pass

Stack Filter Interface

Stacks are made of filters. Here we define an interface that is common to all filter types:

Type
Returns the filter type. This is a string that identifies the type of the filter, and will be used to determine if two filter objects can be compared. If you don't want your Compare() method called with all kinds of other filters you should make sure this string is unique.
Compare
Compares to another filter and returns LXiSTACK_IDENTICAL if the results of these filters would be the same, LXiSTACK_COMPATIBLE if the output of the other filter can be converted to this one's, or LXiSTACK_DIFFERENT if they are irreconcilable.
Convert
If this filter is unused but found to be compatible with another of the same type, the Convert() method will be called to convert this one to match the new desired form. The filter should remember the jist of the differences and update destination object when applied.
Identifier
This is expected to return an identifier that identifies this filter in an evaluation stack.

(5) SDK: ILxStackFilter interface
         LXxMETHOD( const char *,
 Type) (
         LXtObjectID                      self);
 
         LXxMETHOD( unsigned,
 Compare) (
         LXtObjectID                      self,
         LXtObjectID                      other);
 
         LXxMETHOD( LxResult,
 Convert) (
         LXtObjectID                      self,
         LXtObjectID                      other);
 
         LXxMETHOD( LxResult,
 Identifier) (
         LXtObjectID                      self,
         const char                     **identifier);

(6) SDK: Declarations
 #define LXiSTACK_DIFFERENT       0
 #define LXiSTACK_COMPATIBLE      1
 #define LXiSTACK_IDENTICAL       2
 
 #define LXu_STACKFILTER         "D1A07939-DB83-4869-9427-A78D134DA575"

(7) User Class: StackFilter method

Empty StackFilter Python user class.

(8) PY: StackFilter method
 pass

ILxStackFilter1 (Legacy Interface)

(9) SDK: ILxStackFilter1 interface
         LXxMETHOD( const char *,
 Type) (
         LXtObjectID                      self);
 
         LXxMETHOD( unsigned,
 Compare) (
         LXtObjectID                      self,
         LXtObjectID                      other);
 
         LXxMETHOD( LxResult,
 Convert) (
         LXtObjectID                      self,
         LXtObjectID                      other);

(10) SDK: Declarations
 #define LXu_STACKFILTER1        "B79CF5D3-C630-401B-82A5-AD866BC05B6F"

Cache Data Interface

Items stored in the cache are simple COM objects with a single method - the Size method. Size is provided by the client so that the cache system may effectively manage memory since it has no knowledge of the data itself.

Size
The Size method is used to allow the cache system to query the CacheData object to determine its size for memory managemnt purposes and only memory management purposes. Calling this function does no allocation or anything other than reporting how much memory this object uses.

(11) SDK: ILxCacheData interface
         LXxMETHOD( unsigned int,
 Size) (
         LXtObjectID                      self);

(12) SDK: Declarations
 #define LXu_CACHEDATA           "7561D111-72BD-4C0C-9E2D-9268A0EC30C2"

(13) User Class: CacheData method

Empty CacheData Python user class.

(14) PY: CacheData method
 pass

Cache Service

The Cache Service is basically the above Cache functions wrapped into a COM object and exported to SDK.

Register
Clients are added to the cache by simply registering their name. Success means the new client has been created and initialized. Failure means the client already exists.
Release
Frees all of the data objects stored in the named cache. Note that the data objects stored in the client will just have XObjectRelease called on them.
GetData
Passes back by reference the object in the named cache for the given key. Returns result code.
SetData
Adds the data object to the named cache.
PurgeData
Frees (XObjectReleases) all of the data in the named cache.

(15) SDK: ILxCacheService interface
         LXxMETHOD(  LxResult,
 ScriptQuery) (
         LXtObjectID              self,
         void                   **ppvObj);

(16) SDK: ILxCacheService interface
         LXxMETHOD( LxResult,
 Register) (
         LXtObjectID                      self,
         const char                      *name);

(17) SDK: ILxCacheService interface
         LXxMETHOD( void,
 Release) (
         LXtObjectID                      self,
         const char                      *name);

(18) SDK: ILxCacheService interface
         LXxMETHOD( LxResult,
 GetData) (
         LXtObjectID                      self,
         const char                      *name,
         unsigned int                     key,
         void                            **ppvObj);

(19) SDK: ILxCacheService interface
         LXxMETHOD( LxResult,
 SetData) (
         LXtObjectID                      self,
         const char                      *name,
         unsigned int                     key,
         LXtObjectID                      data);

(20) SDK: ILxCacheService interface
         LXxMETHOD( void,
 PurgeData) (
         LXtObjectID                      self,
         const char                      *name);

(21) SDK: Declarations
 #define LXu_CACHESERVICE         "6BB353D3-179A-477A-AC23-946DECB45A37"

(22) User Service Class: CacheService method

Empty CacheData Python user class.

(23) PY: CacheService method
 pass