filter (lx_filter.hpp)

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


Evaluation Stack Interface

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

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

(3) SDK: CLxUser_EvaluationStack::MakeBranch 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: empty EvaluationStack user class
 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: StackFilter::Type, etc.
         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: LXiSTACK_DIFFERENT, etc. defines
 #define LXiSTACK_DIFFERENT       0
 #define LXiSTACK_COMPATIBLE      1
 #define LXiSTACK_IDENTICAL       2
 
 #define LXu_STACKFILTER         "D1A07939-DB83-4869-9427-A78D134DA575"

(7) SDK: empty StackFilter User Class

Empty StackFilter Python user class.

(8) PY: empty StackFilter user class
 pass

ILxStackFilter1 (Legacy Interface)

(9) SDK: StackFilter1::Type, etc.
         LXxMETHOD( const char *,
 Type) (
         LXtObjectID                      self);
 
         LXxMETHOD( unsigned,
 Compare) (
         LXtObjectID                      self,
         LXtObjectID                      other);
 
         LXxMETHOD( LxResult,
 Convert) (
         LXtObjectID                      self,
         LXtObjectID                      other);

(10) SDK: LXu_STACKFILTER1 define
 #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: CacheData::Size
         LXxMETHOD( unsigned int,
 Size) (
         LXtObjectID                      self);

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

(13) SDK: empty CacheData User Class

Empty CacheData Python user class.

(14) PY: empty CacheData user class
 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: CacheService::ScriptQuery
         LXxMETHOD(  LxResult,
 ScriptQuery) (
         LXtObjectID              self,
         void                   **ppvObj);

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

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

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

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

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

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

(22) SDK: empty CacheService User Class

Empty CacheData Python user class.

(23) PY: empty Service.Cache user class
 pass