Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

kore::ServiceProvider::Service Class Reference

class kore::ServiceProvider::Service - helper class which holds service information, such as service's provider, name and description. More...

#include <serviceprovider.h>

List of all members.

Public Methods

 Service (ServiceProvider *provider, const char *name, const char *description)
 Constructor. More...

ServiceProviderprovider () const
 Gets the ServiceProvider this Service is associated to. More...

const char * name () const
 Gets the service name. More...

 operator const char * () const
 This is a convenience alias to name(). More...

const char * description () const
 Gets the service description. More...


Private Attributes

vector< string > _path
string _leaf
Service * _parent
ServiceProvider_provider
const char * _name
const char * _description


Detailed Description

class kore::ServiceProvider::Service - helper class which holds service information, such as service's provider, name and description.

Service naming scheme: a service name consists of one or more alfanumeric strings separated by '/' (slash). Example: "foo/bar/baz" is a legal service name. A service name has 2 components: path ("foo/bar/") and leaf ("baz"). Under some circumstances the leaf may be missing ("foo/bar/"). The path constists of one or more path elements ("foo" and "bar") separated by '/'. Illegal characters: '/' is an illegal character in both path elements and leaf (since '/' is the path separator). '*' (star) and '?' (question mark) are illegal characters in path elements, but they can be used as leaf elements. Please note that '*' and '?' as leaf elements have special meanings for the service naming sheme. The service which have '?' as their leaf element are called "active services". All the others are 'passive services'.

Definition at line 40 of file serviceprovider.h.


Constructor & Destructor Documentation

ServiceProvider::Service::Service ServiceProvider   provider,
const char *    name,
const char *    description
 

Constructor.

Parameters:
provider  - the ServiceProvider this Service is associated to.
name  - the Service name.
description  - Service description string.

Definition at line 10 of file serviceprovider.cpp.

References _description, _leaf, _name, _parent, _path, _provider, description(), name(), and provider().

00011 {
00012     _provider = provider;
00013     _name = name;
00014     _description = description;
00015     _parent = 0;
00016     string srv(name);
00017     unsigned i = 0;
00018     unsigned j = 0;
00019     // split the string into pieces
00020     while( j < srv.size() )
00021     {
00022         j = srv.find('/',i);
00023         if( srv[j] == '/' )
00024         {
00025             _path.push_back(string(srv, i, j - i));
00026 //            cout << string(srv, i, j-i) << "/\n";
00027         }
00028         else
00029         {
00030             _leaf = string(srv, i, j-i);
00031 //            cout << string(srv, i, j-1) << endl;
00032         }
00033         i = j+1;
00034     }
00035 //        cout << "============\n";
00036 }


Member Function Documentation

const char * ServiceProvider::Service::description   const
 

Gets the service description.

Returns:
- service description string.

Definition at line 49 of file serviceprovider.cpp.

References _description.

Referenced by Service().

00050 {
00051     return _description;
00052 }

const char * ServiceProvider::Service::name   const
 

Gets the service name.

Returns:
- service name.

Definition at line 41 of file serviceprovider.cpp.

References _name.

Referenced by Service().

00042 {
00043     return _name;
00044 }

ServiceProvider::Service::operator const char *   const
 

This is a convenience alias to name().

Returns:
- service name.

Definition at line 45 of file serviceprovider.cpp.

References _name.

00046 {
00047     return _name;
00048 }

ServiceProvider * ServiceProvider::Service::provider   const
 

Gets the ServiceProvider this Service is associated to.

Returns:
- who provides this service.

Definition at line 37 of file serviceprovider.cpp.

References _provider, and kore::ServiceProvider::ServiceProvider().

Referenced by Service().

00038 {
00039     return _provider;
00040 }


Member Data Documentation

const char* kore::ServiceProvider::Service::_description [private]
 

Definition at line 83 of file serviceprovider.h.

Referenced by description(), and Service().

string kore::ServiceProvider::Service::_leaf [private]
 

Definition at line 75 of file serviceprovider.h.

Referenced by Service().

const char* kore::ServiceProvider::Service::_name [private]
 

Definition at line 81 of file serviceprovider.h.

Referenced by name(), operator const char *(), and Service().

Service* kore::ServiceProvider::Service::_parent [private]
 

Definition at line 77 of file serviceprovider.h.

Referenced by Service().

vector<string> kore::ServiceProvider::Service::_path [private]
 

Definition at line 73 of file serviceprovider.h.

Referenced by Service().

ServiceProvider* kore::ServiceProvider::Service::_provider [private]
 

Definition at line 79 of file serviceprovider.h.

Referenced by provider(), and Service().


The documentation for this class was generated from the following files:
Generated on Sat Feb 16 05:44:11 2002 for Korelib by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001