This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
HdSchema Class Reference

Schema classes represent a structured view of the inherently unstructured container data source passed into the constructor. More...

#include <schema.h>

+ Inheritance diagram for HdSchema:

Public Types

using UnderlyingDataSource = HdContainerDataSource
 

Public Member Functions

 HdSchema (HdContainerDataSourceHandle container)
 
HD_API HdContainerDataSourceHandle GetContainer () const
 Returns the container data source that this schema is interpreting.
 
HD_API bool IsDefined () const
 
 operator bool () const
 Returns true if this schema is applied on top of a non-null container.
 

Protected Member Functions

template<typename T >
T::Handle _GetTypedDataSource (TfToken name) const
 Returns a datasource of the requested type for the given name: schema implementations can use this to ask for child containers, sampled values, vectors, etc.
 

Protected Attributes

HdContainerDataSourceHandle _container
 

Detailed Description

Schema classes represent a structured view of the inherently unstructured container data source passed into the constructor.

They're used to represent what fields a given object is expected to have. Note that a schema can be applied to a container which doesn't contain all of the named fields; in that case, some of the field accessors will return null, and the caller should use default values for those fields.

Definition at line 25 of file schema.h.

Member Typedef Documentation

◆ UnderlyingDataSource

Definition at line 42 of file schema.h.

Constructor & Destructor Documentation

◆ HdSchema()

HdSchema ( HdContainerDataSourceHandle  container)
inline

Definition at line 28 of file schema.h.

Member Function Documentation

◆ _GetTypedDataSource()

T::Handle _GetTypedDataSource ( TfToken  name) const
inlineprotected

Returns a datasource of the requested type for the given name: schema implementations can use this to ask for child containers, sampled values, vectors, etc.

If the key has the wrong type, this function returns null.

Definition at line 52 of file schema.h.

◆ GetContainer()

HD_API HdContainerDataSourceHandle GetContainer ( ) const

Returns the container data source that this schema is interpreting.

◆ operator bool()

operator bool ( ) const
inlineexplicit

Returns true if this schema is applied on top of a non-null container.

Definition at line 40 of file schema.h.

Member Data Documentation

◆ _container

HdContainerDataSourceHandle _container
protected

Definition at line 45 of file schema.h.


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