Ginga  0.13.6.2086-83aa
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
 Objects.
 
map< string, Object * > _objectsById
 Objects indexed by id.
 
Context_root
 Root context (body).
 
MediaSettings_settings
 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__".

Returns
New Document.

◆ ~Document()

Document::~Document ( )
virtual

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.

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

◆ getObjectById()

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

Gets document object by id.

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

◆ getObjectByIdOrAlias()

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

Gets document object by id or alias.

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

◆ getObjects()

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

Gets document objects.

Returns
The set of objects in document.

◆ getRoot()

Context * Document::getRoot ( )

Gets document's root object.

Returns
The root object.

◆ getSettings()

MediaSettings * Document::getSettings ( )

Gets document's settings object.

Returns
The settings object.

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