HydraExpress™ C++ API Reference Guide

 
Loading...
Searching...
No Matches
rwsf::AgentMethodImp Class Referenceabstract

Abstract base class for implementing Agent methods. More...

#include <rwsf/agent_methods/AgentMethodImp.h>

Inheritance diagram for rwsf::AgentMethodImp:
rwsf::NamedObjectCleanup rwsf::NamedObjectLoader

Public Member Functions

 AgentMethodImp ()
virtual void init (const rwsf::Config &config, const rwsf::AgentContext &manager)=0
virtual void invoke ()=0

(Note that these are not member symbols.)

#define RWSF_DEFINE_METHOD(NAME)

Detailed Description

Class rwsf::AgentMethodImp is the abstract base class for implementing Agent methods, such as rwsf::MessageInfo handlers.

Constructor & Destructor Documentation

◆ AgentMethodImp()

rwsf::AgentMethodImp::AgentMethodImp ( )

Default constructor.

Member Function Documentation

◆ init()

virtual void rwsf::AgentMethodImp::init ( const rwsf::Config & config,
const rwsf::AgentContext & manager )
pure virtual

Initializes the method with configuration options specified in the configuration file rwagent.xml, located in the <installdir>\conf directory.

  • The config parameter holds the configuration properties defined in the config file.
  • The agent parameter is the rwsf::AgentContext, which contains the AgentMethod.

Implemented in rwsf::NamedObjectCleanup, and rwsf::NamedObjectLoader.

◆ invoke()

virtual void rwsf::AgentMethodImp::invoke ( )
pure virtual

Defines the main functionality of the AgentMethod. Anyone extending from this class must implement the invoke() method to define the method's behavior.

Implemented in rwsf::NamedObjectCleanup, and rwsf::NamedObjectLoader.

◆ RWSF_DEFINE_METHOD

#define RWSF_DEFINE_METHOD ( NAME)
related

Defines a function that returns an AgentMethod of type NAME. The macro names the function by prefacing NAME with the word "create". The Agent uses the function to construct an instance of AgentMethod. For example to use the newly defined method you would need to do the following:

Add the following to the implementation file of your newly defined AgentMethod.

RWSF_DEFINE_METHOD(MyAgentMethod)
#define RWSF_DEFINE_METHOD(NAME)
Definition AgentMethodImp.h:85

Add the following element as a child of either the <rwsf:preStartup>, <rwsf:postStartup>, <rwsf:preShutdown>, or <rwsf:postShutdown> element, in the rwagent.xml configuration file.

<rwsf:method name="some-name" class="dllName.createMyAgentMethod"/>

Copyright © 2026 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.