#include <c4d_accessedobjects.h>
An AccessedObjectsCallback is passed to BaseList2D::GetAccessedObjects so that an implementation of BaseList2D can tell which data it will access within methods like ModifyObject or GetVirtualObjects. This is used to parallelize the execution of those methods as much as possible.
Public Member Functions | |
MAXON_METHOD GET_ACCESSED_OBJECTS_FLAGS | AddFlags (GET_ACCESSED_OBJECTS_FLAGS newFlags) |
MAXON_METHOD void | RestoreFlags (GET_ACCESSED_OBJECTS_FLAGS prevFlags) |
MAXON_METHOD Bool | TestFlags (GET_ACCESSED_OBJECTS_FLAGS mask) const |
MAXON_METHOD maxon::Result< Bool > | MarkVisited (const BaseList2D *object) |
MAXON_METHOD Bool | IsReadable (const BaseList2D *object, ACCESSED_OBJECTS_MASK readMask) |
MAXON_METHOD maxon::Result< void > | EnsureReadable (const BaseList2D *object, ACCESSED_OBJECTS_MASK readMask) |
MAXON_METHOD maxon::Result< Bool > | MayAccess (const BaseList2D *object, ACCESSED_OBJECTS_MASK readMask, ACCESSED_OBJECTS_MASK writeMask) |
MAXON_METHOD maxon::Result< Bool > | MayAccessAnything () |
MAXON_METHOD const BaseDocument * | GetDocument () |
MAXON_METHOD BUILDFLAGS | GetBuildFlags () |
Private Member Functions | |
MAXON_INTERFACE_SIMPLE_VIRTUAL (AccessedObjectsCallback, MAXON_REFERENCE_NONE) | |
|
private |
MAXON_METHOD GET_ACCESSED_OBJECTS_FLAGS AddFlags | ( | GET_ACCESSED_OBJECTS_FLAGS | newFlags | ) |
MAXON_METHOD void RestoreFlags | ( | GET_ACCESSED_OBJECTS_FLAGS | prevFlags | ) |
MAXON_METHOD Bool TestFlags | ( | GET_ACCESSED_OBJECTS_FLAGS | mask | ) | const |
MAXON_METHOD maxon::Result<Bool> MarkVisited | ( | const BaseList2D * | object | ) |
Marks object as visited to prevent endless recursion in implementations of BaseList2D::GetAccessedObjects.
[in] | object | An object for which GetAccessedObjects is called. |
MAXON_METHOD Bool IsReadable | ( | const BaseList2D * | object, |
ACCESSED_OBJECTS_MASK | readMask | ||
) |
Checks if the data corresponding to readMask is already readable from object. That's the case unless there's a pending job which will write to that data.
[in] | object | An object. |
[in] | readMask | The data mask for which readability shall be checked. |
MAXON_METHOD maxon::Result<void> EnsureReadable | ( | const BaseList2D * | object, |
ACCESSED_OBJECTS_MASK | readMask | ||
) |
Waits if necessary until the data corresponding to readMask is readable from object. This method will wait as long as there are pending jobs which will write to that data.
[in] | object | An object. |
[in] | readMask | The data mask for which readability shall be checked. |
MAXON_METHOD maxon::Result<Bool> MayAccess | ( | const BaseList2D * | object, |
ACCESSED_OBJECTS_MASK | readMask, | ||
ACCESSED_OBJECTS_MASK | writeMask | ||
) |
Tells the callback that the current method may access object's data corresponding to readMask and writeMask. MayAccess is called in implementations of BaseList2D::GetAccessedObjects. A simple implementation for a generator could look like this:
So when the object's GetVirtualObjects method is called, this may read from the BaseContainer and also from any tag, and it may write to the cache (namely, it writes the generated virtual object). If GetVirtualObjects reads from further objects (e.g., children or linked objects), this has to be matched by additional calls to MayAccess.
[in] | object | An object which the current method will access during execution. |
[in] | readMask | The data identified by readMask will be read from object. |
[in] | writeMask | The data identified by writeMask will be written to object. This also allows to read the data. |
MAXON_METHOD maxon::Result<Bool> MayAccessAnything | ( | ) |
Tells the callback that the current method may access anything from the current document. You have to use this instead of MayAccess if it's unknown or too complex what the current method will actually do.
The default behaviour of BaseList2D::GetAccessedObjects is to call MayAccessAnything.
MAXON_METHOD const BaseDocument* GetDocument | ( | ) |
Returns the current document.
MAXON_METHOD BUILDFLAGS GetBuildFlags | ( | ) |
Returns the current build flags.