The iTV middleware.
Document Class Reference

NCL document. More...

#include <Document.h>

Collaboration diagram for Document:

Public Member Functions

 Document ()
 Creates a new document. More...
virtual ~Document ()
 Destroys document. More...
const set< Object * > * getObjects ()
 Gets document objects. More...
ObjectgetObjectById (const string &)
 Gets document object by id. More...
ObjectgetObjectByIdOrAlias (const string &)
 Gets document object by id or alias. More...
bool addObject (Object *)
 Adds object to document. More...
ContextgetRoot ()
 Gets document's root object. More...
MediaSettingsgetSettings ()
 Gets document's settings object. More...
const set< Media * > * getMedias ()
const set< Context * > * getContexts ()
const set< Switch * > * getSwitches ()
int evalAction (Event *, Event::Transition, const string &value="")
 Evaluates action over document.
int evalAction (Action)
 Evaluates action over document.
bool evalPredicate (Predicate *)
bool evalPropertyRef (const string &, string *)
bool getData (const string &, void **)
bool setData (const string &, void *, UserDataCleanFunc fn=nullptr)

Private Attributes

set< Object * > _objects
map< string, Object * > _objectsById
 Objects indexed by id.
 Root context (body).
 Settings object.
set< Media * > _medias
 Media objects.
set< Context * > _contexts
 Context objects.
set< Switch * > _switches
 Switch objects.
UserData _udata
 Attached user data.

Detailed Description

NCL document.

Maintains all objects in document.

Constructor & Destructor Documentation

◆ Document()

GINGA_NAMESPACE_BEGIN Document::Document ( )

Creates a new document.

This function creates a new NCL document containing a root context (the document body) with id "__root__" and a child settings media object with id "__settings__".

New Document.

◆ ~Document()

Document::~Document ( )

Destroys document.

This function destroys the document and all its child objects.

Member Function Documentation

◆ addObject()

bool Document::addObject ( Object obj)

Adds object to document.

This function assumes that obj is not in another document.

objThe object to add.
true if successful, or false otherwise (object already in document).

◆ getObjectById()

Object * Document::getObjectById ( const string &  id)

Gets document object by id.

idObject id.
The object if successful, or null otherwise.

◆ getObjectByIdOrAlias()

Object * Document::getObjectByIdOrAlias ( const string &  id)

Gets document object by id or alias.

idObject id or alias.
The object if successful, or null otherwise.

◆ getObjects()

const set< Object * > * Document::getObjects ( )

Gets document objects.

The set of objects in document.

◆ getRoot()

Context * Document::getRoot ( )

Gets document's root object.

The root object.

◆ getSettings()

MediaSettings * Document::getSettings ( )

Gets document's settings object.

The settings object.

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