HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dataSource.h File Reference
#include "pxr/pxr.h"
#include "pxr/imaging/hd/api.h"
#include "pxr/imaging/hd/dataSourceLocator.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/vt/value.h"
#include <iosfwd>
#include <memory>
#include <vector>
#include <atomic>
+ Include dependency graph for dataSource.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  HdDataSourceBase
 
class  HdContainerDataSource
 
class  HdVectorDataSource
 
class  HdSampledDataSource
 
class  HdTypedSampledDataSource< T >
 
class  HdBlockDataSource
 

Macros

#define HD_DECLARE_DATASOURCE_ABSTRACT(type)
 
#define HD_DECLARE_DATASOURCE(type)
 
#define HD_DECLARE_DATASOURCE_INITIALIZER_LIST_NEW(type, T)
 
#define HD_DECLARE_DATASOURCE_HANDLES(type)
 

Functions

 HD_DECLARE_DATASOURCE_HANDLES (HdDataSourceBase)
 
 HD_DECLARE_DATASOURCE_HANDLES (HdContainerDataSource)
 
 HD_DECLARE_DATASOURCE_HANDLES (HdVectorDataSource)
 
 HD_DECLARE_DATASOURCE_HANDLES (HdSampledDataSource)
 
 HD_DECLARE_DATASOURCE_HANDLES (HdBlockDataSource)
 
HD_API bool HdGetMergedContributingSampleTimesForInterval (size_t count, const HdSampledDataSourceHandle *inputDataSources, HdSampledDataSource::Time startTime, HdSampledDataSource::Time endTime, std::vector< HdSampledDataSource::Time > *outSampleTimes)
 Merges contributing sample times from several data sources. More...
 
HD_API void HdDebugPrintDataSource (std::ostream &, HdDataSourceBaseHandle, int indentLevel=0)
 Print a datasource to a stream, for debugging/testing. More...
 
HD_API void HdDebugPrintDataSource (HdDataSourceBaseHandle, int indentLevel=0)
 Print a datasource to stdout, for debugging/testing. More...
 

Macro Definition Documentation

#define HD_DECLARE_DATASOURCE (   type)
Value:
template <typename ... Args> \
static Handle New(Args&& ... args) { \
return Handle(new type(std::forward<Args>(args) ... )); \
}
#define HD_DECLARE_DATASOURCE_ABSTRACT(type)
Definition: dataSource.h:45
**If you just want to fire and args
Definition: thread.h:609
type
Definition: core.h:1059
void * Handle
Definition: plugin.h:27

HD_DECLARE_DATASOURCE Used for instantiable classes, this defines functions for manipulating and allocating handles to this type of datasource.

Use of this macro in derived classes is important to make sure that core and client code share the same handle type and allocator.

Definition at line 64 of file dataSource.h.

#define HD_DECLARE_DATASOURCE_ABSTRACT (   type)
Value:
using Handle = std::shared_ptr<type>; \
using AtomicHandle = Handle; \
static Handle AtomicLoad(AtomicHandle &ptr) { \
return std::atomic_load(&ptr); \
} \
static void AtomicStore(AtomicHandle &ptr, const Handle &v) { \
std::atomic_store(&ptr, v); \
} \
static Handle Cast(const HdDataSourceBase::Handle &v) { \
return std::dynamic_pointer_cast<type>(v); \
}
const GLdouble * v
Definition: glcorearb.h:837
auto ptr(T p) -> const void *
Definition: format.h:2448
type
Definition: core.h:1059
void * Handle
Definition: plugin.h:27

HD_DECLARE_DATASOURCE_ABSTRACT Used for non-instantiable classes, this defines a set of functions for manipulating handles to this type of datasource.

Definition at line 45 of file dataSource.h.

#define HD_DECLARE_DATASOURCE_HANDLES (   type)
Value:
using type##AtomicHandle = type::AtomicHandle;
type
Definition: core.h:1059
void * Handle
Definition: plugin.h:27

Definition at line 79 of file dataSource.h.

#define HD_DECLARE_DATASOURCE_INITIALIZER_LIST_NEW (   type,
 
)
Value:
static Handle New(std::initializer_list<T> initList) { \
return Handle(new type(initList)); \
}
type
Definition: core.h:1059
void * Handle
Definition: plugin.h:27

HD_DECLARE_DATASOURCE_INITIALIZER_LIST_NEW Used for declaring a New function for datasource types that have a constructor that takes an initializer_list<T>.

Definition at line 74 of file dataSource.h.

Function Documentation

HD_DECLARE_DATASOURCE_HANDLES ( HdDataSourceBase  )
HD_DECLARE_DATASOURCE_HANDLES ( HdContainerDataSource  )
HD_DECLARE_DATASOURCE_HANDLES ( HdVectorDataSource  )
HD_DECLARE_DATASOURCE_HANDLES ( HdSampledDataSource  )
HD_DECLARE_DATASOURCE_HANDLES ( HdBlockDataSource  )
HD_API void HdDebugPrintDataSource ( std::ostream &  ,
HdDataSourceBaseHandle  ,
int  indentLevel = 0 
)

Print a datasource to a stream, for debugging/testing.

HD_API void HdDebugPrintDataSource ( HdDataSourceBaseHandle  ,
int  indentLevel = 0 
)

Print a datasource to stdout, for debugging/testing.

HD_API bool HdGetMergedContributingSampleTimesForInterval ( size_t  count,
const HdSampledDataSourceHandle *  inputDataSources,
HdSampledDataSource::Time  startTime,
HdSampledDataSource::Time  endTime,
std::vector< HdSampledDataSource::Time > *  outSampleTimes 
)

Merges contributing sample times from several data sources.