Official reference client implementation for Cumulocity SmartREST on u-blox C027.

Dependencies:   C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed

Fork of MbedSmartRestMain by Vincent Wochnik

operation/OperationSupport.h

Committer:
xinlei
Date:
2015-04-20
Revision:
94:61d44636f020
Parent:
93:0acd11870c6a
Child:
99:e369fc75c000

File content as of revision 94:61d44636f020:

#ifndef OPERATIONSUPPORT_H
#define OPERATIONSUPPORT_H

#include "Operation.h"
#include "SmartRest.h"
#include "SmartRestTemplate.h"

class OperationSupport
{
public:
    OperationSupport(SmartRest& client, SmartRestTemplate& tpl,
    long& deviceId, OperationPool& pool):
    _init(false), _firstRun(true), _deviceId(deviceId), _tpl(tpl),
    _client(client), opool(pool) {}
    bool init();
    bool run();

protected:
    bool requestPendingOperations();
    bool executePendingOperation(Operation&);
    bool operationFromRecord(ParsedRecord& record, Operation& op);

private:
    bool _init;
    bool _firstRun;
    long& _deviceId;
    SmartRestTemplate& _tpl;
    SmartRest& _client;
    OperationPool& opool;
};

#endif