libhomegear-base  0.7
Base library for Homegear and Homegear family modules.
BaseLib::ScriptEngine::ScriptInfo Class Reference

This class provides hooks into the script engine server so family modules can be notified about finished script executions. More...

#include <ScriptInfo.h>

Public Types

enum  ScriptType {
  ScriptType::cli, ScriptType::device, ScriptType::device2, ScriptType::web,
  ScriptType::simpleNode, ScriptType::statefulNode
}
 

Public Member Functions

 ScriptInfo (ScriptType type)
 
 ScriptInfo (ScriptType type, std::string &fullPath, std::string &relativePath, std::string &arguments)
 
 ScriptInfo (ScriptType type, std::string &contentPath, std::string &fullPath, std::string &relativePath, Http &http, Rpc::PServerInfo &serverInfo, PRpcClientInfo &clientInfo)
 
 ScriptInfo (BaseLib::SharedObjects *bl, ScriptType type, std::string &contentPath, std::string &fullPath, std::string &relativePath, PVariable http, PVariable serverInfo, PVariable clientInfo)
 
 ScriptInfo (ScriptType type, std::string &fullPath, std::string &relativePath, std::string &script, std::string &arguments)
 
 ScriptInfo (ScriptType type, std::string &fullPath, std::string &relativePath, std::string &script, std::string &arguments, int64_t peerId)
 
 ScriptInfo (ScriptType type, PVariable nodeInfo, std::string &fullPath, std::string &relativePath, uint32_t inputPort, PVariable message)
 
 ScriptInfo (ScriptType type, PVariable nodeInfo, std::string &fullPath, std::string &relativePath, uint32_t maxThreadCount)
 
virtual ~ScriptInfo ()=default
 
ScriptType getType ()
 

Public Attributes

int32_t id = 0
 
std::string fullPath
 
std::string relativePath
 
std::string arguments
 
int32_t customId = 0
 
bool returnOutput = false
 
Http http
 
Rpc::PServerInfo serverInfo
 
PRpcClientInfo clientInfo
 
std::string contentPath
 
std::string script
 
int64_t peerId = 0
 
PVariable nodeInfo
 
uint32_t inputPort = 0
 
PVariable message
 
uint32_t maxThreadCount = 0
 
bool started = false
 
bool finished = false
 
int32_t exitCode = -1
 
std::string output
 
std::function< void(PScriptInfo &scriptInfo, std::string &output, bool error)> scriptOutputCallback
 
std::function< void(PScriptInfo &scriptInfo, PVariable &headers)> scriptHeadersCallback
 
std::function< void(PScriptInfo &scriptInfo, int32_t exitCode)> scriptFinishedCallback
 
std::mutex requestMutex
 
std::condition_variable requestConditionVariable
 
PTcpSocket socket
 

Protected Attributes

ScriptType _type = ScriptType::cli
 

Detailed Description

This class provides hooks into the script engine server so family modules can be notified about finished script executions.

Member Enumeration Documentation

§ ScriptType

Enumerator
cli 
device 
device2 
web 
simpleNode 
statefulNode 

Constructor & Destructor Documentation

§ ScriptInfo() [1/8]

BaseLib::ScriptEngine::ScriptInfo::ScriptInfo ( ScriptInfo::ScriptType  type)
explicit

§ ScriptInfo() [2/8]

BaseLib::ScriptEngine::ScriptInfo::ScriptInfo ( ScriptInfo::ScriptType  type,
std::string &  fullPath,
std::string &  relativePath,
std::string &  arguments 
)

§ ScriptInfo() [3/8]

BaseLib::ScriptEngine::ScriptInfo::ScriptInfo ( ScriptInfo::ScriptType  type,
std::string &  contentPath,
std::string &  fullPath,
std::string &  relativePath,
Http http,
Rpc::PServerInfo serverInfo,
PRpcClientInfo clientInfo 
)

§ ScriptInfo() [4/8]

BaseLib::ScriptEngine::ScriptInfo::ScriptInfo ( BaseLib::SharedObjects bl,
ScriptInfo::ScriptType  type,
std::string &  contentPath,
std::string &  fullPath,
std::string &  relativePath,
PVariable  http,
PVariable  serverInfo,
PVariable  clientInfo 
)

§ ScriptInfo() [5/8]

BaseLib::ScriptEngine::ScriptInfo::ScriptInfo ( ScriptInfo::ScriptType  type,
std::string &  fullPath,
std::string &  relativePath,
std::string &  script,
std::string &  arguments 
)

§ ScriptInfo() [6/8]

BaseLib::ScriptEngine::ScriptInfo::ScriptInfo ( ScriptInfo::ScriptType  type,
std::string &  fullPath,
std::string &  relativePath,
std::string &  script,
std::string &  arguments,
int64_t  peerId 
)

§ ScriptInfo() [7/8]

BaseLib::ScriptEngine::ScriptInfo::ScriptInfo ( ScriptInfo::ScriptType  type,
PVariable  nodeInfo,
std::string &  fullPath,
std::string &  relativePath,
uint32_t  inputPort,
PVariable  message 
)

§ ScriptInfo() [8/8]

BaseLib::ScriptEngine::ScriptInfo::ScriptInfo ( ScriptInfo::ScriptType  type,
PVariable  nodeInfo,
std::string &  fullPath,
std::string &  relativePath,
uint32_t  maxThreadCount 
)

§ ~ScriptInfo()

virtual BaseLib::ScriptEngine::ScriptInfo::~ScriptInfo ( )
virtualdefault

Member Function Documentation

§ getType()

ScriptType BaseLib::ScriptEngine::ScriptInfo::getType ( )
inline

Member Data Documentation

§ _type

ScriptType BaseLib::ScriptEngine::ScriptInfo::_type = ScriptType::cli
protected

§ arguments

std::string BaseLib::ScriptEngine::ScriptInfo::arguments

§ clientInfo

PRpcClientInfo BaseLib::ScriptEngine::ScriptInfo::clientInfo

§ contentPath

std::string BaseLib::ScriptEngine::ScriptInfo::contentPath

§ customId

int32_t BaseLib::ScriptEngine::ScriptInfo::customId = 0

§ exitCode

int32_t BaseLib::ScriptEngine::ScriptInfo::exitCode = -1

§ finished

bool BaseLib::ScriptEngine::ScriptInfo::finished = false

§ fullPath

std::string BaseLib::ScriptEngine::ScriptInfo::fullPath

§ http

Http BaseLib::ScriptEngine::ScriptInfo::http

§ id

int32_t BaseLib::ScriptEngine::ScriptInfo::id = 0

§ inputPort

uint32_t BaseLib::ScriptEngine::ScriptInfo::inputPort = 0

§ maxThreadCount

uint32_t BaseLib::ScriptEngine::ScriptInfo::maxThreadCount = 0

§ message

PVariable BaseLib::ScriptEngine::ScriptInfo::message

§ nodeInfo

PVariable BaseLib::ScriptEngine::ScriptInfo::nodeInfo

§ output

std::string BaseLib::ScriptEngine::ScriptInfo::output

§ peerId

int64_t BaseLib::ScriptEngine::ScriptInfo::peerId = 0

§ relativePath

std::string BaseLib::ScriptEngine::ScriptInfo::relativePath

§ requestConditionVariable

std::condition_variable BaseLib::ScriptEngine::ScriptInfo::requestConditionVariable

§ requestMutex

std::mutex BaseLib::ScriptEngine::ScriptInfo::requestMutex

§ returnOutput

bool BaseLib::ScriptEngine::ScriptInfo::returnOutput = false

§ script

std::string BaseLib::ScriptEngine::ScriptInfo::script

§ scriptFinishedCallback

std::function<void(PScriptInfo& scriptInfo, int32_t exitCode)> BaseLib::ScriptEngine::ScriptInfo::scriptFinishedCallback

§ scriptHeadersCallback

std::function<void(PScriptInfo& scriptInfo, PVariable& headers)> BaseLib::ScriptEngine::ScriptInfo::scriptHeadersCallback

§ scriptOutputCallback

std::function<void(PScriptInfo& scriptInfo, std::string& output, bool error)> BaseLib::ScriptEngine::ScriptInfo::scriptOutputCallback

§ serverInfo

Rpc::PServerInfo BaseLib::ScriptEngine::ScriptInfo::serverInfo

§ socket

PTcpSocket BaseLib::ScriptEngine::ScriptInfo::socket

§ started

bool BaseLib::ScriptEngine::ScriptInfo::started = false

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