CdsResource Class Reference

#include <cds_resource.h>

Inheritance diagram for CdsResource:
zmm::Object

Public Member Functions

 CdsResource (int handlerType)
 creates a new resource object.
 CdsResource (int handlerType, zmm::Ref< Dictionary > attributes, zmm::Ref< Dictionary > parameters, zmm::Ref< Dictionary > options)
void addAttribute (zmm::String name, zmm::String value)
 Adds a resource attribute.
void removeAttribute (zmm::String name)
 Removes a resource attribute.
void mergeAttributes (zmm::Ref< Dictionary > additional)
 Merge existing attributes with new ones.
void addParameter (zmm::String name, zmm::String value)
 Adds a parameter (will be appended to the URL).
void addOption (zmm::String name, zmm::String value)
 Add an option to the resource.
int getHandlerType ()
zmm::Ref< DictionarygetAttributes ()
zmm::Ref< DictionarygetParameters ()
zmm::Ref< DictionarygetOptions ()
zmm::String getAttribute (zmm::String name)
zmm::String getParameter (zmm::String name)
zmm::String getOption (zmm::String name)
bool equals (zmm::Ref< CdsResource > other)
zmm::Ref< CdsResourceclone ()
zmm::String encode ()
void optimize ()
 Frees unnecessary memory.
void retain ()
void release ()
int getRefCount ()

Static Public Member Functions

static zmm::Ref< CdsResourcedecode (zmm::String serial)
static void * operator new (size_t size)
static void operator delete (void *ptr)

Protected Attributes

int handlerType
zmm::Ref< Dictionaryattributes
zmm::Ref< Dictionaryparameters
zmm::Ref< Dictionaryoptions
mt_atomic_t _ref_count
pthread_mutex_t mutex

Detailed Description

Definition at line 48 of file cds_resource.h.


Constructor & Destructor Documentation

CdsResource::CdsResource ( int  handlerType  ) 

creates a new resource object.

The CdsResource object represents a <res> tag in the DIDL-Lite XML.

Parameters:
handler_type id of the associated handler

Definition at line 43 of file cds_resource.cc.

References attributes, options, and parameters.

Referenced by clone(), and decode().

CdsResource::CdsResource ( int  handlerType,
zmm::Ref< Dictionary attributes,
zmm::Ref< Dictionary parameters,
zmm::Ref< Dictionary options 
)

Definition at line 50 of file cds_resource.cc.


Member Function Documentation

void CdsResource::addAttribute ( zmm::String  name,
zmm::String  value 
)

Adds a resource attribute.

This maps to an attribute of the <res> tag in the DIDL-Lite XML.

Parameters:
name attribute name
value attribute value

Definition at line 61 of file cds_resource.cc.

References attributes.

void CdsResource::addOption ( zmm::String  name,
zmm::String  value 
)

Add an option to the resource.

The options are internal, they do not appear in the URL or in the XML but can be used for any purpose.

Definition at line 82 of file cds_resource.cc.

References options.

void CdsResource::addParameter ( zmm::String  name,
zmm::String  value 
)

Adds a parameter (will be appended to the URL).

The parameters will be appended to the object URL in the DIDL-Lite XML. This is useful for cases, where you need to identify specific options, i.e. something that is only relevant to a particular metadata handler and so on. The parameters will be automatically URL encoded.

Parameters:
name parameter name
value parameter value

Definition at line 77 of file cds_resource.cc.

References parameters.

Ref< CdsResource > CdsResource::clone (  ) 

Definition at line 132 of file cds_resource.cc.

References attributes, CdsResource(), handlerType, options, and parameters.

Ref< CdsResource > CdsResource::decode ( zmm::String  serial  )  [static]
String CdsResource::encode (  ) 

Definition at line 140 of file cds_resource.cc.

References attributes, handlerType, options, parameters, and RESOURCE_PART_SEP.

bool CdsResource::equals ( zmm::Ref< CdsResource other  ) 

Definition at line 122 of file cds_resource.cc.

References attributes, handlerType, options, and parameters.

String CdsResource::getAttribute ( zmm::String  name  ) 

Definition at line 107 of file cds_resource.cc.

References attributes.

Ref< Dictionary > CdsResource::getAttributes (  ) 

Definition at line 92 of file cds_resource.cc.

References attributes.

int CdsResource::getHandlerType (  ) 

Definition at line 87 of file cds_resource.cc.

References handlerType.

String CdsResource::getOption ( zmm::String  name  ) 

Definition at line 117 of file cds_resource.cc.

References options.

Ref< Dictionary > CdsResource::getOptions (  ) 

Definition at line 102 of file cds_resource.cc.

References options.

String CdsResource::getParameter ( zmm::String  name  ) 

Definition at line 112 of file cds_resource.cc.

References parameters.

Ref< Dictionary > CdsResource::getParameters (  ) 

Definition at line 97 of file cds_resource.cc.

References parameters.

int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

References zmm::Object::_ref_count, and atomic_get().

void CdsResource::mergeAttributes ( zmm::Ref< Dictionary additional  ) 

Merge existing attributes with new ones.

Definition at line 71 of file cds_resource.cc.

References attributes.

void Object::operator delete ( void *  ptr  )  [static, inherited]

Definition at line 87 of file object.cc.

References FREE.

void * Object::operator new ( size_t  size  )  [static, inherited]

Definition at line 83 of file object.cc.

References MALLOC.

void CdsResource::optimize (  ) 

Frees unnecessary memory.

Definition at line 181 of file cds_resource.cc.

References attributes, options, and parameters.

void Object::release (  )  [inherited]
void CdsResource::removeAttribute ( zmm::String  name  ) 

Removes a resource attribute.

Parameters:
name attribute name

Definition at line 66 of file cds_resource.cc.

References attributes.

void Object::retain (  )  [inherited]

Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]
int CdsResource::handlerType [protected]

Definition at line 51 of file cds_resource.h.

Referenced by clone(), decode(), encode(), equals(), and getHandlerType().

pthread_mutex_t zmm::Object::mutex [protected, inherited]

Definition at line 54 of file cds_resource.h.

Referenced by addOption(), CdsResource(), clone(), encode(), equals(), getOption(), getOptions(), and optimize().


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

Generated on Fri Mar 26 20:16:56 2010 for MediaTomb by  doxygen 1.6.1