#include <serviceprovider.h>
Public Methods | |
Service (ServiceProvider *provider, const char *name, const char *description) | |
Constructor. More... | |
ServiceProvider * | provider () 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 |
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.
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 } |
|
Gets the service description.
Definition at line 49 of file serviceprovider.cpp. References _description. Referenced by Service().
00050 { 00051 return _description; 00052 } |
|
Gets the service name.
Definition at line 41 of file serviceprovider.cpp. References _name. Referenced by Service().
00042 { 00043 return _name; 00044 } |
|
This is a convenience alias to name().
Definition at line 45 of file serviceprovider.cpp. References _name.
00046 { 00047 return _name; 00048 } |
|
Gets the ServiceProvider this Service is associated to.
Definition at line 37 of file serviceprovider.cpp. References _provider, and kore::ServiceProvider::ServiceProvider(). Referenced by Service().
00038 { 00039 return _provider; 00040 } |
|
Definition at line 83 of file serviceprovider.h. Referenced by description(), and Service(). |
|
Definition at line 75 of file serviceprovider.h. Referenced by Service(). |
|
Definition at line 81 of file serviceprovider.h. Referenced by name(), operator const char *(), and Service(). |
|
Definition at line 77 of file serviceprovider.h. Referenced by Service(). |
|
Definition at line 73 of file serviceprovider.h. Referenced by Service(). |
|
Definition at line 79 of file serviceprovider.h. |