Fledge
An open source edge computing platform for industrial users
SendingProcess Class Reference
Inheritance diagram for SendingProcess:
Collaboration diagram for SendingProcess:

Public Member Functions

 SendingProcess (int argc, char **argv)
 
 ~SendingProcess ()
 SendingProcess class methods.
 
void run () const
 
void stop ()
 
int getStreamId () const
 
bool isRunning () const
 
void stopRunning ()
 
void setLastFetchId (unsigned long id)
 
unsigned long getLastFetchId () const
 
void setLastSentId (unsigned long id)
 
unsigned long getLastSentId () const
 
unsigned long getSentReadings () const
 
bool updateSentReadings (unsigned long num)
 
void resetSentReadings ()
 
void updateDatabaseCounters ()
 Update database tables statistics and streams setting last_object id in streams.
 
bool getLastSentReadingId ()
 Get last_object id sent for current stream_id Access foglam.streams table. More...
 
bool createStream (int)
 Creates a new stream, it adds a new row into the streams table allocating specific stream id. More...
 
int createNewStream ()
 Creates a new stream, it adds a new row into the streams table allocating a new stream id. More...
 
unsigned int getDuration () const
 
unsigned int getSleepTime () const
 
bool getUpdateDb () const
 
bool setUpdateDb (bool val)
 
unsigned long getReadBlockSize () const
 
const std::string & getDataSourceType () const
 
const std::string & getPluginName () const
 
void setLoadBufferIndex (unsigned long loadBufferIdx)
 Set the current buffer load index. More...
 
unsigned long getLoadBufferIndex () const
 Get the current buffer load index. More...
 
const unsigned long * getLoadBufferIndexPtr () const
 Get the current buffer load index pointer. More...
 
unsigned long getMemoryBufferSize () const
 
void createConfigCategories (DefaultConfigCategory configCategory, std::string parent_name, std::string current_name, std::string current_description)
 Creates config categories and sub categories recursively, along with their parent-child relations.
 
- Public Member Functions inherited from FledgeProcess
 FledgeProcess (int argc, char **argv)
 
StorageClientgetStorageClient () const
 Return storage client.
 
ManagementClientgetManagementClient () const
 Return management client.
 
LoggergetLogger () const
 Return Logger.
 
std::string getName () const
 
time_t getStartTime () const
 

Static Public Member Functions

static void setLoadBufferData (unsigned long index, ReadingSet *readings)
 
static std::vector< ReadingSet * > * getDataBuffers ()
 
static void useFilteredData (OUTPUT_HANDLE *outHandle, READINGSET *readings)
 Use the current input readings (they have been filtered by all filters) More...
 
static void passToOnwardFilter (OUTPUT_HANDLE *outHandle, READINGSET *readings)
 Pass the current readings set to the next filter in the pipeline. More...
 

Public Attributes

std::vector< ReadingSet * > m_buffer
 
std::thread * m_thread_load
 
std::thread * m_thread_send
 
NorthPluginm_plugin
 
std::vector< unsigned long > m_last_read_id
 
NorthFilterPipelinefilterPipeline
 

Additional Inherited Members

- Protected Member Functions inherited from FledgeProcess
std::string getArgValue (const std::string &name) const
 Get command line argument value like "--xyx=ABC" Argument name to pass is "--xyz=". More...
 
- Protected Attributes inherited from FledgeProcess
bool m_dryRun
 

Constructor & Destructor Documentation

◆ SendingProcess()

SendingProcess::SendingProcess ( int  argc,
char **  argv 
)

Get Configuration from sending process and loaded plugin Create or update configuration via Fledge API

Member Function Documentation

◆ createNewStream()

int SendingProcess::createNewStream ( )

Creates a new stream, it adds a new row into the streams table allocating a new stream id.

Returns
newly created stream, 0 otherwise

◆ createStream()

bool SendingProcess::createStream ( int  streamId)

Creates a new stream, it adds a new row into the streams table allocating specific stream id.

Returns
true if successful created, false otherwise

◆ getLastSentReadingId()

bool SendingProcess::getLastSentReadingId ( )

Get last_object id sent for current stream_id Access foglam.streams table.

Returns
true if last_object is found, false otherwise

◆ getLoadBufferIndex()

unsigned long SendingProcess::getLoadBufferIndex ( ) const

Get the current buffer load index.

Returns
The buffer load index the load thread is using

◆ getLoadBufferIndexPtr()

const unsigned long * SendingProcess::getLoadBufferIndexPtr ( ) const

Get the current buffer load index pointer.

NOTE: this routine must be called only to pass the index pointer to the last filter in the pipeline for the readings set.

Returns
The pointer to the buffer load index being used by the load thread

◆ passToOnwardFilter()

void SendingProcess::passToOnwardFilter ( OUTPUT_HANDLE *  outHandle,
READINGSET readings 
)
static

Pass the current readings set to the next filter in the pipeline.

Note: This routine must be passed to all filters "plugin_init" except the last one

Static method

Parameters
outHandlePointer to next filter
readingsCurrent readings set

◆ setLoadBufferIndex()

void SendingProcess::setLoadBufferIndex ( unsigned long  loadBufferIndex)

Set the current buffer load index.

Parameters
loadBufferIndexThe buffer load index the load thread is using

◆ useFilteredData()

void SendingProcess::useFilteredData ( OUTPUT_HANDLE *  outHandle,
READINGSET readings 
)
static

Use the current input readings (they have been filtered by all filters)

Note: This routine must passed to last filter "plugin_init" only

Static method

Parameters
outHandlePointer to current buffer index where to add the readings
readingsFiltered readings to add to buffer[index]

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