SMACC2
Loading...
Searching...
No Matches
cl_gcalcli::ClGcalcli Class Reference

SMACC2 Client for Google Calendar integration via gcalcli. More...

#include <cl_gcalcli.hpp>

Inheritance diagram for cl_gcalcli::ClGcalcli:
Inheritance graph
Collaboration diagram for cl_gcalcli::ClGcalcli:
Collaboration graph

Public Member Functions

 ClGcalcli ()
 
 ClGcalcli (const GcalcliConfig &config)
 
virtual ~ClGcalcli ()=default
 
void configure (const GcalcliConfig &config)
 Set configuration before initialization.
 
const GcalcliConfiggetConfig () const
 Get current configuration.
 
template<typename TOrthogonal , typename TClient >
void onComponentInitialization ()
 Template method for component initialization with orthogonal context.
 
CpGcalcliConnectiongetConnection ()
 
CpCalendarPollergetPoller ()
 
CpCalendarEventListenergetEventListener ()
 
- Public Member Functions inherited from smacc2::ISmaccClient
 ISmaccClient ()
 
virtual ~ISmaccClient ()
 
virtual void onInitialize ()
 
virtual std::string getName () const
 
template<typename TComponent >
TComponent * getComponent ()
 
template<typename TComponent >
TComponent * getComponent (std::string name)
 
template<typename TComponent >
TComponent * getComponent (int index)
 
virtual smacc2::introspection::TypeInfo::Ptr getType ()
 
ISmaccStateMachinegetStateMachine ()
 
template<typename TSmaccSignal , typename T >
void connectSignal (TSmaccSignal &signal, void(T::*callback)(), T *object)
 
template<typename SmaccClientType >
void requiresClient (SmaccClientType *&storage)
 
void getComponents (std::vector< std::shared_ptr< ISmaccComponent > > &components)
 
const std::vector< std::shared_ptr< ISmaccComponent > > & iterateComponents () const
 
template<typename EventType >
void postEvent (const EventType &ev)
 
template<typename EventType >
void postEvent ()
 

Private Attributes

GcalcliConfig config_
 

Additional Inherited Members

- Protected Member Functions inherited from smacc2::ISmaccClient
template<typename TOrthogonal , typename TClient >
void onComponentInitialization ()
 
template<typename TOrthogonal , typename TSourceObject >
void onStateOrthogonalAllocation ()
 
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs>
SmaccComponentType * createComponent (TArgs... targs)
 
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs>
SmaccComponentType * createNamedComponent (std::string name, TArgs... targs)
 
rclcpp::Node::SharedPtr getNode ()
 
rclcpp::Logger getLogger ()
 
- Protected Attributes inherited from smacc2::ISmaccClient
std::map< ComponentKey, std::shared_ptr< smacc2::ISmaccComponent > > components_
 

Detailed Description

SMACC2 Client for Google Calendar integration via gcalcli.

This client provides Google Calendar functionality through the gcalcli command-line tool. It follows the pure orchestrator pattern, creating and configuring components that implement the actual functionality.

Components:

Usage example:

class OrCalendar : public smacc2::Orthogonal<OrCalendar> {
void onInitialize() override {
config.poll_interval = std::chrono::seconds{30};
}
};
virtual void onInitialize()
std::shared_ptr< ClientHandler< TOrthogonal, TClient > > createClient(TArgs... args)
Configuration for gcalcli client.
Definition types.hpp:102
std::chrono::seconds poll_interval
How often to poll for agenda updates.
Definition types.hpp:113

Definition at line 53 of file cl_gcalcli.hpp.

Constructor & Destructor Documentation

◆ ClGcalcli() [1/2]

cl_gcalcli::ClGcalcli::ClGcalcli ( )

Definition at line 20 of file cl_gcalcli.cpp.

20{}

◆ ClGcalcli() [2/2]

cl_gcalcli::ClGcalcli::ClGcalcli ( const GcalcliConfig & config)
explicit

Definition at line 22 of file cl_gcalcli.cpp.

22: config_(config) {}
GcalcliConfig config_

◆ ~ClGcalcli()

virtual cl_gcalcli::ClGcalcli::~ClGcalcli ( )
virtualdefault

Member Function Documentation

◆ configure()

void cl_gcalcli::ClGcalcli::configure ( const GcalcliConfig & config)

Set configuration before initialization.

Definition at line 24 of file cl_gcalcli.cpp.

24{ config_ = config; }

References config_.

◆ getConfig()

const GcalcliConfig & cl_gcalcli::ClGcalcli::getConfig ( ) const
inline

Get current configuration.

Definition at line 68 of file cl_gcalcli.hpp.

68{ return config_; }

References config_.

◆ getConnection()

CpGcalcliConnection * cl_gcalcli::ClGcalcli::getConnection ( )
inline

Definition at line 91 of file cl_gcalcli.hpp.

91{ return this->getComponent<CpGcalcliConnection>(); }

References smacc2::ISmaccClient::getComponent().

Referenced by cl_gcalcli::CbMonitorConnection::onEntry(), cl_gcalcli::CbQuickAdd::onEntry(), cl_gcalcli::CbStatus::onEntry(), and cl_gcalcli::CbWaitConnection::onEntry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEventListener()

CpCalendarEventListener * cl_gcalcli::ClGcalcli::getEventListener ( )
inline

Definition at line 95 of file cl_gcalcli.hpp.

96 {
98 }

References smacc2::ISmaccClient::getComponent().

Referenced by cl_gcalcli::CbDetectCalendarEvent::onEntry(), and cl_gcalcli::CbEventDetect::onEntry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPoller()

CpCalendarPoller * cl_gcalcli::ClGcalcli::getPoller ( )
inline

Definition at line 93 of file cl_gcalcli.hpp.

93{ return this->getComponent<CpCalendarPoller>(); }

References smacc2::ISmaccClient::getComponent().

Referenced by cl_gcalcli::CbRefreshAgenda::onEntry(), and cl_gcalcli::CbStatus::onEntry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onComponentInitialization()

template<typename TOrthogonal , typename TClient >
void cl_gcalcli::ClGcalcli::onComponentInitialization ( )
inline

Template method for component initialization with orthogonal context.

Definition at line 74 of file cl_gcalcli.hpp.

75 {
76 // Create the subprocess executor (from smacc2 core)
77 this->createComponent<
79
80 // Create gcalcli-specific components
82 connection->configure(config_);
83
86
87 RCLCPP_INFO(getLogger(), "[ClGcalcli] Components created");
88 }
rclcpp::Logger getLogger()
SmaccComponentType * createComponent(TArgs... targs)
Generic subprocess execution component for running CLI tools.

References config_, smacc2::ISmaccClient::createComponent(), and smacc2::ISmaccClient::getLogger().

Here is the call graph for this function:

Member Data Documentation

◆ config_

GcalcliConfig cl_gcalcli::ClGcalcli::config_
private

Definition at line 101 of file cl_gcalcli.hpp.

Referenced by configure(), getConfig(), and onComponentInitialization().


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