Sirikata
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
Sirikata::PollingService Class Reference

A service which needs to be polled periodically. More...

#include <PollingService.hpp>

Inheritance diagram for Sirikata::PollingService:
Collaboration diagram for Sirikata::PollingService:

List of all members.

Public Member Functions

 PollingService (Network::IOStrand *str, const char *cb_tag, const Duration &max_rate=Duration::microseconds(0), Context *ctx=NULL, const String &name="", bool accurate=false)
 ~PollingService ()
virtual void start ()
 Start polling this service on this strand at the given maximum rate.
virtual void stop ()
 Stop scheduling this service.

Protected Member Functions

virtual void poll ()=0
 Override this method to specify the work to be done when polling.
virtual void shutdown ()
 Override this method to clean up when a shutdown is requested.

Private Member Functions

void indirectPoll ()

Private Attributes

TimeProfiler::StagemProfiler

Detailed Description

A service which needs to be polled periodically.

This class handles scheduling and polling the service and only requires the user to override a single poll() method.


Constructor & Destructor Documentation

Sirikata::PollingService::PollingService ( Network::IOStrand str,
const char *  cb_tag,
const Duration max_rate = Duration::microseconds(0),
Context ctx = NULL,
const String &  name = "",
bool  accurate = false 
)
Sirikata::PollingService::~PollingService ( )

References mProfiler.


Member Function Documentation

void Sirikata::PollingService::indirectPoll ( ) [private]
virtual void Sirikata::PollingService::poll ( ) [protected, pure virtual]
virtual void Sirikata::PollingService::shutdown ( ) [inline, protected, virtual]

Override this method to clean up when a shutdown is requested.

Referenced by stop().

void Sirikata::PollingService::start ( ) [virtual]
void Sirikata::PollingService::stop ( ) [virtual]

Stop scheduling this service.

Note that this does not immediately stop the service, it simply guarantees the service will not be scheduled again. This allows outstanding events to be handled properly.

Reimplemented from Sirikata::PollerService.

Reimplemented in Sirikata::Graphics::ResourceDownloadPlanner, Sirikata::Graphics::PriorityDownloadPlanner, Sirikata::SessionManager, Sirikata::LocationService, Sirikata::Proximity, Sirikata::LibproxManualProximity, Sirikata::LibproxProximityBase, and Sirikata::DistributedCoordinateSegmentation.

References shutdown().

Referenced by Sirikata::SessionManager::handleSpaceConnection().


Member Data Documentation


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