Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

propertyservice::PropertyServer Class Reference

#include <PropertyServer.h>

Inheritance diagram for propertyservice::PropertyServer:

propertyservice::PropertyControl List of all members.

Detailed Description

PropertyServer is a wrap-up for server programs that implement the PropertyService Corba interface.

Programmers are completely unaware of the underlying Corba calls as they only need to implement to virtual methods.


Public Methods

 PropertyServer () throw (ORBException&)
 Initialize the internal corba wrapper using default values.

 PropertyServer (CORBA::ORB_ptr orb) throw (ORBException&)
 Initialize the internal corba wrapper with the given orb.

 PropertyServer (std::string host, std::string objectName) throw (ORBException&)
 Create a new PropertyServer and bind it to a name service at the given host with the given name.

virtual void setProperty (const util::List< std::string > &nameParts, util::Blob< char > value)=0 throw (PropertyException&)
 Set a property in the server.

virtual util::Blob< char > * getProperty (const util::List< std::string > &nameParts)=0 throw (PropertyException&)
 Get the value of a property in the server.

std::string getIor ()
 Get the current inter-operable object reference of this server.


Protected Methods

template<class T> void firePropertyChange (std::string propertyName, T &propertyValue) throw (util::io::IOException&, util::xml::XMLException&)
 Inform all registered listeners about a change in a property value.


Friends

class PropertyServerWrapper


Constructor & Destructor Documentation

propertyservice::PropertyServer::PropertyServer std::string    host,
std::string    objectName
throw (ORBException&)
 

Create a new PropertyServer and bind it to a name service at the given host with the given name.

Parameters:
host  a host name in the form myhost.com[:port]
objectName  the name of this server object. Assumes the form 'context/subcontext/name'.


Member Function Documentation

template<class T>
void propertyservice::PropertyServer::firePropertyChange std::string    propertyName,
T &    propertyValue
throw (util::io::IOException&, util::xml::XMLException&) [protected]
 

Inform all registered listeners about a change in a property value.

Parameters:
propertyName  the name of the property that changed
propertyValue  the new value of the property

virtual util::Blob<char>* propertyservice::PropertyServer::getProperty const util::List< std::string > &    nameParts throw (PropertyException&) [pure virtual]
 

Get the value of a property in the server.

The value is returned as an encoded Blob, which is most easily created using PropertyControl::encodeProperty(). The returned blob must point to a newly allocated memory segment that can be released using the delete operator.

Parameters:
nameParts  the name of the property whose value is to be fetched, split into parts using '.' as a field separator.
Returns:
the encoded property value

Implemented in MobileRobotServer.

virtual void propertyservice::PropertyServer::setProperty const util::List< std::string > &    nameParts,
util::Blob< char >    value
throw (PropertyException&) [pure virtual]
 

Set a property in the server.

This method is invoked each time a client invokes a Corba setProperty call.

Parameters:
nameParts  the name of the property whose value is to be set split into parts using '.' as a field separator.
value  the new property value encoded in a Blob. One may want to use the decodeProperty method found in PropertyControl to get a decoded property value.

Implemented in MobileRobotServer.


The documentation for this class was generated from the following files:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.