LiveSupport::Core::RdsContainer Class Reference

#include <RdsContainer.h>

Inheritance diagram for LiveSupport::Core::RdsContainer:

[legend]
Collaboration diagram for LiveSupport::Core::RdsContainer:

[legend]
List of all members.

Detailed Description

Container holding RdsItem objects.

It is used by the OptionContainer class to hold RDS strings (see http://en.wikipedia.org/wiki/Radio_Data_System).

This object has to be configured with an XML configuration element called rdsContainer. This may look like the following:


  <rdsContainer>
      <rdsItem> ... </rdsItem>
      <rdsItem> ... </rdsItem>
      ...
      <rdsItem> ... </rdsItem>
  </rdsContainer>
  

The DTD for the expected XML element is the following:


  <!ELEMENT rdsContainer (rdsItem*) >
  

For a description of the rdsItem XML element, see the documentation of the RdsItem class.

Author:
Author
fgerlits
Version:
Revision
3185
See also:
KeyboardShortcut

Definition at line 95 of file RdsContainer.h.

Public Member Functions

 RdsContainer () throw ()
 Constructor.
virtual ~RdsContainer (void) throw ()
 A virtual destructor, as this class has virtual functions.
virtual void configure (const xmlpp::Element &element) throw (std::invalid_argument)
 Configure the object based on an XML configuration element.
void setRdsOptions (Ptr< const Glib::ustring >::Ref key, Ptr< const Glib::ustring >::Ref value, bool enabled) throw ()
 Set the value of the RDS options.
Ptr< const Glib::ustring
>::Ref 
getRdsValue (Ptr< const Glib::ustring >::Ref key) throw (std::invalid_argument)
 Get the value of an RDS string.
bool getRdsEnabled (Ptr< const Glib::ustring >::Ref key) throw (std::invalid_argument)
 Get the enabled/disabled state of an RDS option.
Ptr< Glib::ustring >::Ref toString (void) throw ()
 Convert the object to a string.
const xmlpp::Element * toXmlElement (void) throw ()
 Convert the object to XML.
bool isTouched (void) throw ()
 Tells you whether the object has been touched since the last save.

Static Public Member Functions

static const std::string getConfigElementName (void) throw ()
 Return the name of the XML element this object expects to be sent to a call to configure().


Constructor & Destructor Documentation

LiveSupport::Core::RdsContainer::RdsContainer (  )  throw () [inline]

Constructor.

Definition at line 130 of file RdsContainer.h.

virtual LiveSupport::Core::RdsContainer::~RdsContainer ( void   )  throw () [inline, virtual]

A virtual destructor, as this class has virtual functions.

Definition at line 139 of file RdsContainer.h.


Member Function Documentation

void RdsContainer::configure ( const xmlpp::Element &  element  )  throw (std::invalid_argument) [virtual]

Configure the object based on an XML configuration element.

Parameters:
element the XML configuration element.
Exceptions:
std::invalid_argument if the supplied XML element contains bad configuration information.

Implements LiveSupport::Core::Configurable.

Definition at line 62 of file RdsContainer.cxx.

static const std::string LiveSupport::Core::RdsContainer::getConfigElementName ( void   )  throw () [inline, static]

Return the name of the XML element this object expects to be sent to a call to configure().

Returns:
the name of the expected XML configuration element.

Definition at line 150 of file RdsContainer.h.

Referenced by LiveSupport::Core::OptionsContainer::writeToFile().

bool RdsContainer::getRdsEnabled ( Ptr< const Glib::ustring >::Ref  key  )  throw (std::invalid_argument)

Get the enabled/disabled state of an RDS option.

Parameters:
key which setting to modify.
Returns:
true if the RDS option is enabled, false otherwise.
Exceptions:
std::invalid_argument if there is no such RDS option.

Definition at line 142 of file RdsContainer.cxx.

Ptr< const Glib::ustring >::Ref RdsContainer::getRdsValue ( Ptr< const Glib::ustring >::Ref  key  )  throw (std::invalid_argument)

Get the value of an RDS string.

The key can be any of the RDS data codes, like PS, PI, PTY, RT, etc.

Parameters:
key which setting to modify.
Returns:
the value of the RDS setting.
Exceptions:
std::invalid_argument if there is no such RDS option.

Definition at line 122 of file RdsContainer.cxx.

bool LiveSupport::Core::RdsContainer::isTouched ( void   )  throw () [inline]

Tells you whether the object has been touched since the last save.

Starts out false; set to true by setRdsString() and set back to false by toXmlElement().

Returns:
whether the object has been touched.

Definition at line 230 of file RdsContainer.h.

void RdsContainer::setRdsOptions ( Ptr< const Glib::ustring >::Ref  key,
Ptr< const Glib::ustring >::Ref  value,
bool  enabled 
) throw ()

Set the value of the RDS options.

The key can be any of the RDS data codes, like PS, PI, PTY, RT, etc. If there is already a value set for this code, it gets overwritten, otherwise a new key-value pair is added.

Parameters:
key which setting to modify.
value the new value of the RDS setting.
enabled whether this value will be broadcast.

Definition at line 91 of file RdsContainer.cxx.

Ptr< Glib::ustring >::Ref RdsContainer::toString ( void   )  throw ()

Convert the object to a string.

Returns:
a string which can be sent to the RDS encoder.

Definition at line 162 of file RdsContainer.cxx.

const xmlpp::Element * RdsContainer::toXmlElement ( void   )  throw ()

Convert the object to XML.

Returns:
an XML Element, which can be passed to configure() to create an object identical to this one.

Definition at line 180 of file RdsContainer.cxx.


The documentation for this class was generated from the following files:
Generated on Sat Sep 22 02:00:38 2007 for Campcaster by  1.4.7