HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_CustomHandlers Class Reference

#include <PDG_CustomHandlers.h>

+ Inheritance diagram for PDG_CustomHandlers:

Classes

class  CacheHandler
 
class  DirtyHandler
 Custom functor for handling dirtied work items, and possibly output. More...
 
class  PreflightHandler
 Custom handler functor for running pre-flight logic before a cook. More...
 
class  RegenerationHandler
 
class  StatHandler
 Custom functor for stating a file and returning a size/hash. More...
 
struct  StatPair
 
class  TransferHandler
 
struct  TransferPair
 

Public Types

enum  CacheResult { eCacheMiss, eCacheHit, eCacheSkip }
 Return result for custom cache handlers. More...
 
enum  RegenerateResult { eRegenerateAll, eRegenerateAttributes, eRegenerateNever, eRegenerateSkip }
 
enum  TransferResult { eTransferFailure, eTransferSuccess, eTransferSkip, eTransferCached }
 Enumeration of different file transfer handle results. More...
 
enum  DirtyHandlerType { eDirtyAny, eDirtyDelete, eDirtyDeleteFiles }
 Enumeration of different levels of dirty handler. More...
 
using CacheHandlerPtr = UT_UniquePtr< CacheHandler >
 Unique pointer to a custom cache handler. More...
 
using CacheHandlerMap = UT_SortedStringMap< CacheHandlerPtr >
 Cache handler map. More...
 
using StatHandlerPtr = UT_UniquePtr< StatHandler >
 Unique pointer to a custom stat handler. More...
 
using StatHandlerMap = UT_SortedStringMap< StatHandlerPtr >
 State handler map. More...
 
using DirtyHandlerPtr = UT_UniquePtr< DirtyHandler >
 Unique pointer to a custom delete handler. More...
 
using DirtyHandlerArray = UT_Array< DirtyHandlerPtr >
 Delete handler map. More...
 
using RegenHandlerPtr = UT_UniquePtr< RegenerationHandler >
 Unique pointer to a custom regeneration handler. More...
 
using RegenHandlerArray = UT_Array< RegenHandlerPtr >
 Regeneration handler array. More...
 
using TransferHandlerPtr = UT_UniquePtr< TransferHandler >
 Unique pointer to a custom transfer handler. More...
 
using TransferHandlerMap = UT_SortedStringMap< TransferHandlerPtr >
 Transfer handler array. More...
 
using PreflightHandlerPtr = UT_UniquePtr< PreflightHandler >
 Unique pointer to a custom preflight handler. More...
 
using PreflightHandlerArray = UT_Array< PreflightHandlerPtr >
 Preflight handler array. More...
 

Public Member Functions

const CacheHandlerMapcacheHandlers () const
 Returns the map of cache handlers, tag -> handler. More...
 
const StatHandlerMapstatHandlers () const
 Returns the map of stat handlers, tag -> handler. More...
 
const TransferHandlerMaptransferHandlers () const
 Returns the map of transfer handlers, tag -> handler. More...
 
const DirtyHandlerArraydirtyHandlers () const
 Returns the array of dirty handlers. More...
 
const RegenHandlerArrayregenerationHandlers () const
 
const PreflightHandlerArraypreflightHandlers () const
 
bool addCacheHandler (const UT_StringHolder &tag, CacheHandler *handler)
 
bool addStatHandler (const UT_StringHolder &tag, StatHandler *handler)
 
void addDirtyHandler (DirtyHandler *handler)
 Adds a custom delete handler. More...
 
void addRegenerationHandler (RegenerationHandler *handler)
 Adds a custom regeneration handler. More...
 
bool addTransferHandler (const UT_StringHolder &tag, TransferHandler *handler)
 Adds a custom transfer handler. More...
 
void addPreflightHandler (PreflightHandler *handler)
 Adds a custom preflight handler. More...
 
bool hasDirtyHandlers (DirtyHandlerType type) const
 Returns true if there are any custom dirty handlers registered. More...
 
void clearHandlers ()
 Clears all cache and delete handlers. More...
 
CacheResult handleCache (const UT_StringHolder &local_path, const PDG_File &file, const PDG_WorkItem *work_item) const
 Checks if a given file path is cached. More...
 
StatPair handleStat (const UT_StringHolder &local_path, const PDG_File &file, const PDG_WorkItem *work_item) const
 Returns the hash/mod time of the file. More...
 
void handleDirtyGlobal (bool delete_items, bool remove_outputs) const
 
bool handleDirty (const PDG_WorkItem *work_item, const PDG_File::Set &files, bool delete_items, bool remove_outputs) const
 
RegenerateResult handleRegenerate (PDG_Node *node, const PDG_WorkItemArray &items)
 
TransferPair handleTransfer (const UT_FileStat &local_stat, const UT_StringHolder &local_path, const UT_StringHolder &remote_path, const PDG_File &file, const PDG_WorkItem *work_item, const PDG_Scheduler *scheduler, exint last_update) const
 
bool handlePreflight (const PDG_CookOptions &options, PDG_GraphContext *context, UT_WorkBuffer &errors)
 

Protected Member Functions

 PDG_CustomHandlers ()
 Constructs a new instance of the table. More...
 
- Protected Member Functions inherited from UT_NonCopyableNS::UT_NonCopyable
 UT_NonCopyable ()=default
 
 ~UT_NonCopyable ()=default
 
 UT_NonCopyable (const UT_NonCopyable &)=delete
 
UT_NonCopyableoperator= (const UT_NonCopyable &)=delete
 

Friends

class PDG_TypeRegistry
 

Detailed Description

Definition at line 36 of file PDG_CustomHandlers.h.

Member Typedef Documentation

Cache handler map.

Definition at line 258 of file PDG_CustomHandlers.h.

Unique pointer to a custom cache handler.

Definition at line 255 of file PDG_CustomHandlers.h.

Delete handler map.

Definition at line 272 of file PDG_CustomHandlers.h.

Unique pointer to a custom delete handler.

Definition at line 269 of file PDG_CustomHandlers.h.

Preflight handler array.

Definition at line 293 of file PDG_CustomHandlers.h.

Unique pointer to a custom preflight handler.

Definition at line 290 of file PDG_CustomHandlers.h.

Regeneration handler array.

Definition at line 279 of file PDG_CustomHandlers.h.

Unique pointer to a custom regeneration handler.

Definition at line 276 of file PDG_CustomHandlers.h.

State handler map.

Definition at line 265 of file PDG_CustomHandlers.h.

Unique pointer to a custom stat handler.

Definition at line 262 of file PDG_CustomHandlers.h.

Transfer handler array.

Definition at line 286 of file PDG_CustomHandlers.h.

Unique pointer to a custom transfer handler.

Definition at line 283 of file PDG_CustomHandlers.h.

Member Enumeration Documentation

Return result for custom cache handlers.

Enumerator
eCacheMiss 

The custom handler has determined that the file was not cached.

eCacheHit 

The custom handler has determined that the file was found.

eCacheSkip 

The custom handler does not wish to handle the file.

Definition at line 40 of file PDG_CustomHandlers.h.

Enumeration of different levels of dirty handler.

Enumerator
eDirtyAny 

The custom dirty handler runs for any dirtied work items.

eDirtyDelete 

The custom dirty handler runs only for work items that are being deleted

eDirtyDeleteFiles 

The custom dirty handler runs only for work itesm that are being deleted, and have their outputs removed from disk

Definition at line 89 of file PDG_CustomHandlers.h.

Enunmerations of different work item regeneration levels that can returned by the correpsonding handler.

Enumerator
eRegenerateAll 

Normal work item regeneration, including both attributes and cache file invalidation.

eRegenerateAttributes 

Regenerate attributes but leave cache files as-is.

eRegenerateNever 

Do not regenerate work item attributes nor invalidate cache files.

eRegenerateSkip 

Ignore the handler.

Definition at line 54 of file PDG_CustomHandlers.h.

Enumeration of different file transfer handle results.

Enumerator
eTransferFailure 

The custom handler failed to transfer the file.

eTransferSuccess 

The custom handler successfully transfered the file.

eTransferSkip 

The custom handler chose not to transfer the file, and it should be handled by the next handler in the list or the default.

eTransferCached 

The custom handler determined that the file was cached/already transfered, and no further attempts should be made to copy it

Definition at line 71 of file PDG_CustomHandlers.h.

Constructor & Destructor Documentation

PDG_CustomHandlers::PDG_CustomHandlers ( )
protected

Constructs a new instance of the table.

Member Function Documentation

bool PDG_CustomHandlers::addCacheHandler ( const UT_StringHolder tag,
CacheHandler handler 
)

Adds a custom tag prefix -> cache handler mapping. Returns true if an existing entry was replaced.

void PDG_CustomHandlers::addDirtyHandler ( DirtyHandler handler)

Adds a custom delete handler.

void PDG_CustomHandlers::addPreflightHandler ( PreflightHandler handler)

Adds a custom preflight handler.

void PDG_CustomHandlers::addRegenerationHandler ( RegenerationHandler handler)

Adds a custom regeneration handler.

bool PDG_CustomHandlers::addStatHandler ( const UT_StringHolder tag,
StatHandler handler 
)

Adds a custom tag prefix -> hash handler mapping. Returns true if an existing entry was replaced.

bool PDG_CustomHandlers::addTransferHandler ( const UT_StringHolder tag,
TransferHandler handler 
)

Adds a custom transfer handler.

const CacheHandlerMap& PDG_CustomHandlers::cacheHandlers ( ) const
inline

Returns the map of cache handlers, tag -> handler.

Definition at line 297 of file PDG_CustomHandlers.h.

void PDG_CustomHandlers::clearHandlers ( )

Clears all cache and delete handlers.

const DirtyHandlerArray& PDG_CustomHandlers::dirtyHandlers ( ) const
inline

Returns the array of dirty handlers.

Definition at line 309 of file PDG_CustomHandlers.h.

CacheResult PDG_CustomHandlers::handleCache ( const UT_StringHolder local_path,
const PDG_File file,
const PDG_WorkItem work_item 
) const

Checks if a given file path is cached.

bool PDG_CustomHandlers::handleDirty ( const PDG_WorkItem work_item,
const PDG_File::Set files,
bool  delete_items,
bool  remove_outputs 
) const

Called when a work item should delete files, and runs any custom handlers that match the item

void PDG_CustomHandlers::handleDirtyGlobal ( bool  delete_items,
bool  remove_outputs 
) const

Called before a dirty w/ deleted outputs, in order to run global delete handlers

bool PDG_CustomHandlers::handlePreflight ( const PDG_CookOptions options,
PDG_GraphContext context,
UT_WorkBuffer errors 
)

Called when the graph run preflight logic, and returns false if any of the handlers fail.

RegenerateResult PDG_CustomHandlers::handleRegenerate ( PDG_Node node,
const PDG_WorkItemArray items 
)

Called when a node is going to regenerate work items, to see if it should.

StatPair PDG_CustomHandlers::handleStat ( const UT_StringHolder local_path,
const PDG_File file,
const PDG_WorkItem work_item 
) const

Returns the hash/mod time of the file.

TransferPair PDG_CustomHandlers::handleTransfer ( const UT_FileStat local_stat,
const UT_StringHolder local_path,
const UT_StringHolder remote_path,
const PDG_File file,
const PDG_WorkItem work_item,
const PDG_Scheduler scheduler,
exint  last_update 
) const

Called when a file needs to be transfered to the working directory of a scheduler

bool PDG_CustomHandlers::hasDirtyHandlers ( DirtyHandlerType  type) const

Returns true if there are any custom dirty handlers registered.

const PreflightHandlerArray& PDG_CustomHandlers::preflightHandlers ( ) const
inline

Definition at line 317 of file PDG_CustomHandlers.h.

const RegenHandlerArray& PDG_CustomHandlers::regenerationHandlers ( ) const
inline

Definition at line 313 of file PDG_CustomHandlers.h.

const StatHandlerMap& PDG_CustomHandlers::statHandlers ( ) const
inline

Returns the map of stat handlers, tag -> handler.

Definition at line 301 of file PDG_CustomHandlers.h.

const TransferHandlerMap& PDG_CustomHandlers::transferHandlers ( ) const
inline

Returns the map of transfer handlers, tag -> handler.

Definition at line 305 of file PDG_CustomHandlers.h.

Friends And Related Function Documentation

friend class PDG_TypeRegistry
friend

Definition at line 407 of file PDG_CustomHandlers.h.


The documentation for this class was generated from the following file: