kDB: Knowledge DataBase
Loading...
Searching...
No Matches
kDBRobotics::Agents Class Reference

#include <Agents.h>

Classes

struct  OperatorOptions
 
struct  Private
 

Public Member Functions

 Agents (const Agents &_rhs)
 
Agents operator= (const Agents &_rhs)
 
bool operator== (const Agents &_dss) const
 
bool isValid () const
 
bool isReadOnly () const
 
knowCore::Uri uri () const
 
kDB::Repository::Connection connection () const
 
std::size_t count () const
 
knowCore::ReturnValue< Agentagent (const knowCore::Uri &_agentUri) const
 
knowCore::ReturnValue< Streamstream (const knowCore::Uri &_streamUri) const
 
knowCore::ReturnValue< bool > hasAgent (const knowCore::Uri &_agentUri) const
 
knowCore::ReturnValue< bool > hasStream (const knowCore::Uri &_streamUri) const
 
knowCore::ReturnValue< QList< Stream > > streamsOf (const knowCore::Uri &_resource) const
 
QList< Agentall () const
 
knowCore::ReturnValue< QList< Agent > > agents (const QList< QPair< knowCore::Uri, knowCore::ConstrainedValue > > &_constraints, const OperatorOptions &_operatorOptions=OperatorOptions()) const
 
template<typename... _TArgs_>
knowCore::ReturnValue< QList< Agent > > agents (const knowCore::Uri &_uri, const knowCore::ConstrainedValue &_constraint, const _TArgs_ &...) const
 
knowCore::ReturnValue< AgentcreateAgent (const knowCore::Uri &_typeUri, const QString &_name, const knowCore::Uri &_agentUri=knowCore::Uri::createUnique({"agent"}))
 
knowCore::ReturnValue< StreamcreateStream (const knowCore::Uri &_contentTypeUri, const QString &_identifier, const knowCore::Uri &_dataTypeUri, const knowCore::Uri &_streamUri=knowCore::Uri::createUnique({"stream"}))
 

Static Public Member Functions

static knowCore::ReturnValue< Agentsget (const kDB::Repository::Connection &_connection, const knowCore::Uri &_graph)
 
static knowCore::ReturnValue< Agentscreate (const kDB::Repository::Connection &_connection, const knowCore::Uri &_graph)
 
static knowCore::ReturnValue< AgentsgetOrCreate (const kDB::Repository::Connection &_connection, const knowCore::Uri &_graph)
 
static Agents allAgents (const kDB::Repository::Connection &_connection)
 
static knowCore::ReturnValue< QList< knowCore::Uri > > allAgentsUris (const kDB::Repository::Connection &_connection)
 

Friends

class ::TestAgents
 

Detailed Description

Interface a kDB::Repository::TriplesStore that contains a set of agents.

Member Function Documentation

◆ agent()

knowCore::ReturnValue< Agent > Agents::agent ( const knowCore::Uri & _agentUri) const
Returns
the agent with the Uri _agentUri

◆ agents()

knowCore::ReturnValue< QList< Agent > > Agents::agents ( const QList< QPair< knowCore::Uri, knowCore::ConstrainedValue > > & _constraints,
const OperatorOptions & _operatorOptions = OperatorOptions() ) const
Parameters
_constraintsa list of pair of list of uris representing the property uri and a constraint.
_operatorOptionsset the precision used by operators
Returns
the list of agents that satisfies the constraints

◆ all()

QList< Agent > Agents::all ( ) const
Returns
all the agent contained in this document.

◆ allAgents()

Agents Agents::allAgents ( const kDB::Repository::Connection & _connection)
static
Returns
an interface to the view that covers all agents.

◆ allAgentsUris()

knowCore::ReturnValue< QList< knowCore::Uri > > Agents::allAgentsUris ( const kDB::Repository::Connection & _connection)
static
Returns
a list of the uris of all agents documents.

◆ connection()

kDB::Repository::Connection Agents::connection ( ) const
Returns
the connection

◆ count()

std::size_t Agents::count ( ) const
Returns
the number of agents in this document.

◆ create()

knowCore::ReturnValue< Agents > Agents::create ( const kDB::Repository::Connection & _connection,
const knowCore::Uri & _graph )
static

Create a new kDB::Repository::TriplesStore with uri _graph, add it to the union of agents Uris::kdb_sensing::agents.

Returns
an invalid Agents if an error occurs or if the agents already exists

◆ createAgent()

knowCore::ReturnValue< Agent > Agents::createAgent ( const knowCore::Uri & _typeUri,
const QString & _name,
const knowCore::Uri & _agentUri = knowCore::Uri::createUnique({"agent"}) )

Create a new Agent of uri type _typeUri with name _name and add it to this agent graph.

◆ createStream()

knowCore::ReturnValue< Stream > Agents::createStream ( const knowCore::Uri & _contentTypeUri,
const QString & _identifier,
const knowCore::Uri & _dataTypeUri,
const knowCore::Uri & _streamUri = knowCore::Uri::createUnique({"stream"}) )

Create a new Stream of uri type _typeUri with name _name and add it to this agent graph.

◆ get()

knowCore::ReturnValue< Agents > Agents::get ( const kDB::Repository::Connection & _connection,
const knowCore::Uri & _graph )
static

Return an unique instance of the agents stored in _graph for a given _connection

Returns
an invalid Agents if it does not exists

◆ getOrCreate()

knowCore::ReturnValue< Agents > Agents::getOrCreate ( const kDB::Repository::Connection & _connection,
const knowCore::Uri & _graph )
static

Create or access the agents specified in _graph

Returns
an invalid Agents if an error occurs

◆ hasAgent()

knowCore::ReturnValue< bool > Agents::hasAgent ( const knowCore::Uri & _agentUri) const
Returns
true if the agent already exists.

◆ hasStream()

knowCore::ReturnValue< bool > Agents::hasStream ( const knowCore::Uri & _streamUri) const
Returns
true if the stream already exists.

◆ isReadOnly()

bool Agents::isReadOnly ( ) const
Returns
true if it can only be used to access agents and not insert one.

◆ isValid()

bool Agents::isValid ( ) const
Returns
true if it is a valid set of agents

◆ stream()

knowCore::ReturnValue< Stream > Agents::stream ( const knowCore::Uri & _streamUri) const
Returns
the stream with the Uri _agentUri

◆ streamsOf()

knowCore::ReturnValue< QList< Stream > > Agents::streamsOf ( const knowCore::Uri & _resource) const
Returns
all the streams associated to a resource.

◆ uri()

knowCore::Uri Agents::uri ( ) const
Returns
the uri for the graph

The documentation for this class was generated from the following files: