17#ifndef CRABMEAT_SERVICEREGISTRY_H_
18#define CRABMEAT_SERVICEREGISTRY_H_
20#include "crabmeat-common.h"
21#include "json/cbm_json.h"
22#include "string/cbm_string.h"
33typedef std::string service_name_t;
41template <
typename _T >
45 typedef typename std::list< _T >::iterator iterator;
46 typedef typename std::list< _T >::const_iterator const_iterator;
49 {
return this->v.size(); }
51 {
return this->v.empty(); }
54 void push_back( _T
const & _elem)
56 for ( iterator elem = this->begin();
57 elem != this->end(); ++elem)
59 if ( elem->id == _elem.id)
62 this->v.push_back( _elem);
66 {
return this->v.front(); }
68 { this->v.pop_front(); }
71 {
return this->v.begin(); }
73 {
return this->v.end(); }
74 const_iterator begin()
const
75 {
return this->v.begin(); }
76 const_iterator end()
const
77 {
return this->v.end(); }
81struct entities_t :
public _cbm_vector< cbm::entity_t >
84typedef rapidjson::Value service_properties_t;
93 cbm::service_properties_t
const * m;
96struct services_t :
public _cbm_vector< cbm::service_t >
99struct service_registry_t
101 service_registry_t();
102 ~service_registry_t();
104 lerr_t connect(
char const *
108 cbm::string_t serialize();
110 cbm::services_t query_providers( std::string
const & ,
111 lflags_t = SREG_NONE,
int * = NULL )
const;
113 service_properties_t
const * query_service_properties(
114 std::string ,
int * )
const;
118 std::string m_regurl;
119 rapidjson::Document m_reg;
123struct service_discover_t
125 service_discover_t( cbm::service_registry_t
const * = NULL);
127 cbm::service_t discover( std::string
const & ,
128 cbm::services_t
const & ,
129 int * = NULL )
const;
130 cbm::service_properties_t
const * service_properties(
131 cbm::service_t
const &)
const;
134 cbm::service_registry_t
const * m_reg;
137struct workflow_compositer_t
139 workflow_compositer_t( service_registry_t
const *);
141 cbm::services_t resolve(
142 cbm::entities_t
const & ,
143 cbm::services_t
const & ,
int * );
146 cbm::service_discover_t m_servd;
The "Service Registry" holds information about available services (e.g., models, readers,...
Definition Lresources.h:51