ginga 1.0
The Ginga iTV middleware
Loading...
Searching...
No Matches
ginga::Document Class Reference

NCL document. More...

#include <Document.h>

Collaboration diagram for ginga::Document:

Public Member Functions

 Document ()
 Creates a new document.
 
 Document (const string &)
 Creates a new document with id.
 
virtual ~Document ()
 Destroys document.
 
const set< Object * > * getObjects ()
 Gets document objects.
 
ObjectgetObjectById (const string &)
 Gets document object by id.
 
ObjectgetObjectByIdOrAlias (const string &)
 Gets document object by id or alias.
 
bool addObject (Object *)
 Adds object to document.
 
const string getId ()
 Gets document id.
 
ContextgetRoot ()
 Gets document's root object.
 
MediaSettingsgetSettings ()
 Gets document's settings object.
 
const set< Media * > * getMedias ()
 
const set< Media * > * getMediasRemote ()
 
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 Member Functions

list< ActionevalActionInContext (Action, Context *)
 Evaluates action over Context.
 

Private Attributes

string _id
 
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< Media * > _mediasRemote
 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() [1/2]

ginga::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() [2/2]

ginga::Document::Document ( const string & id)

Creates a new document with id.

Returns
New Document.

◆ ~Document()

ginga::Document::~Document ( )
virtual

Destroys document.

This function destroys the document and all its child objects.

Member Function Documentation

◆ addObject()

bool ginga::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).

◆ getId()

const string ginga::Document::getId ( )

Gets document id.

Returns
Id string.

◆ getObjectById()

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

Gets document object by id.

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

◆ getObjectByIdOrAlias()

Object * ginga::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 * > * ginga::Document::getObjects ( )

Gets document objects.

Returns
The set of objects in document.

◆ getRoot()

Context * ginga::Document::getRoot ( )

Gets document's root object.

Returns
The root object.

◆ getSettings()

MediaSettings * ginga::Document::getSettings ( )

Gets document's settings object.

Returns
The settings object.

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