Cortex  10.0.0-a4
Public Member Functions | List of all members
IECore::AttributeBlock Class Reference

A context object intended for use with python's "with" syntax. More...

#include <AttributeBlock.h>

Inherits noncopyable.

Public Member Functions

 AttributeBlock (RendererPtr renderer, bool active=true)
 
 ~AttributeBlock ()
 
def __init__ (self, renderer)
 
def __enter__ (self)
 
def __exit__ (self, type, value, traceBack)
 

Detailed Description

A context object intended for use with python's "with" syntax.

The AttributeBlock class provides a simple means of ensuring that renderer->attributeBegin() calls are matched by renderer->attributeEnd() calls, even in the face of exceptions and multiple return statements from a function.

It calls renderer.attributeBegin() in enter and renderer.attributeEnd() in exit.

Constructor & Destructor Documentation

IECore::AttributeBlock::AttributeBlock ( RendererPtr  renderer,
bool  active = true 
)

Starts a new attribute block, calling renderer->attributeBegin(). If active is false then nothing is done.

IECore::AttributeBlock::~AttributeBlock ( )

Closes the attribute block by calling renderer->attributeEnd(). If active was false in the constructor then nothing is done.


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