MythTV  master
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ZMServer Class Reference

#include <zmserver.h>

Collaboration diagram for ZMServer:
Collaboration graph
[legend]

Public Member Functions

 ZMServer (int sock, bool debug)
 
 ~ZMServer ()
 
bool processRequest (char *buf, int nbytes)
 

Private Member Functions

std::string getZMSetting (const std::string &setting) const
 
bool send (const std::string &s) const
 
bool send (const std::string &s, const unsigned char *buffer, int dataLen) const
 
void sendError (const std::string &error)
 
void getMonitorList (void)
 
void handleHello (void)
 
void handleGetServerStatus (void)
 
void handleGetMonitorStatus (void)
 
void handleGetAlarmStates (void)
 
void handleGetMonitorList (void)
 
void handleGetCameraList (void)
 
void handleGetEventList (std::vector< std::string > tokens)
 
void handleGetEventFrame (std::vector< std::string > tokens)
 
void handleGetAnalysisFrame (std::vector< std::string > tokens)
 
void handleGetLiveFrame (std::vector< std::string > tokens)
 
void handleGetFrameList (std::vector< std::string > tokens)
 
void handleDeleteEvent (std::vector< std::string > tokens)
 
void handleDeleteEventList (std::vector< std::string > tokens)
 
void handleGetEventDates (std::vector< std::string > tokens)
 
void handleRunZMAudit (void)
 
void handleSetMonitorFunction (std::vector< std::string > tokens)
 
void zmcControl (MONITOR *monitor, const std::string &mode)
 
void zmaControl (MONITOR *monitor, const std::string &mode)
 

Static Private Member Functions

static int getFrame (FrameData &buffer, MONITOR *monitor)
 
static long long getDiskSpace (const std::string &filename, long long &total, long long &used)
 
static void tokenize (const std::string &command, std::vector< std::string > &tokens)
 
static std::string runCommand (const std::string &command)
 
static void getMonitorStatus (const std::string &id, const std::string &type, const std::string &device, const std::string &host, const std::string &channel, const std::string &function, std::string &zmcStatus, std::string &zmaStatus, const std::string &enabled)
 

Private Attributes

bool m_debug {false}
 
int m_sock {-1}
 
std::vector< MONITOR * > m_monitors
 
std::map< int, MONITOR * > m_monitorMap
 
bool m_useDeepStorage {false}
 
bool m_useAnalysisImages {false}
 
std::string m_eventFileFormat
 
std::string m_analysisFileFormat
 
key_t m_shmKey
 
std::string m_mmapPath
 

Detailed Description

Definition at line 302 of file zmserver.h.

Constructor & Destructor Documentation

◆ ZMServer()

ZMServer::ZMServer ( int  sock,
bool  debug 
)

Definition at line 510 of file zmserver.cpp.

◆ ~ZMServer()

ZMServer::~ZMServer ( )

Definition at line 583 of file zmserver.cpp.

Member Function Documentation

◆ processRequest()

bool ZMServer::processRequest ( char *  buf,
int  nbytes 
)

Definition at line 629 of file zmserver.cpp.

Referenced by main().

◆ getZMSetting()

std::string ZMServer::getZMSetting ( const std::string &  setting) const
private

Definition at line 1910 of file zmserver.cpp.

Referenced by zmaControl(), and ZMServer().

◆ send() [1/2]

bool ZMServer::send ( const std::string &  s) const
private

◆ send() [2/2]

bool ZMServer::send ( const std::string &  s,
const unsigned char *  buffer,
int  dataLen 
) const
private

Definition at line 704 of file zmserver.cpp.

◆ sendError()

void ZMServer::sendError ( const std::string &  error)
private

◆ getMonitorList()

void ZMServer::getMonitorList ( void  )
private

Definition at line 1706 of file zmserver.cpp.

Referenced by ZMServer().

◆ getFrame()

int ZMServer::getFrame ( FrameData buffer,
MONITOR monitor 
)
staticprivate

Definition at line 1778 of file zmserver.cpp.

Referenced by handleGetLiveFrame().

◆ getDiskSpace()

long long ZMServer::getDiskSpace ( const std::string &  filename,
long long &  total,
long long &  used 
)
staticprivate

Definition at line 740 of file zmserver.cpp.

Referenced by handleGetServerStatus().

◆ tokenize()

void ZMServer::tokenize ( const std::string &  command,
std::vector< std::string > &  tokens 
)
staticprivate

Definition at line 606 of file zmserver.cpp.

Referenced by processRequest().

◆ handleHello()

void ZMServer::handleHello ( void  )
private

Definition at line 730 of file zmserver.cpp.

Referenced by processRequest().

◆ runCommand()

std::string ZMServer::runCommand ( const std::string &  command)
staticprivate

◆ getMonitorStatus()

void ZMServer::getMonitorStatus ( const std::string &  id,
const std::string &  type,
const std::string &  device,
const std::string &  host,
const std::string &  channel,
const std::string &  function,
std::string &  zmcStatus,
std::string &  zmaStatus,
const std::string &  enabled 
)
staticprivate

Definition at line 1085 of file zmserver.cpp.

Referenced by handleGetMonitorStatus().

◆ handleGetServerStatus()

void ZMServer::handleGetServerStatus ( void  )
private

Definition at line 769 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetMonitorStatus()

void ZMServer::handleGetMonitorStatus ( void  )
private

Definition at line 978 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetAlarmStates()

void ZMServer::handleGetAlarmStates ( void  )
private

Definition at line 803 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetMonitorList()

void ZMServer::handleGetMonitorList ( void  )
private

Definition at line 1581 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetCameraList()

void ZMServer::handleGetCameraList ( void  )
private

Definition at line 1565 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetEventList()

void ZMServer::handleGetEventList ( std::vector< std::string >  tokens)
private

Definition at line 823 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetEventFrame()

void ZMServer::handleGetEventFrame ( std::vector< std::string >  tokens)
private

Definition at line 1136 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetAnalysisFrame()

void ZMServer::handleGetAnalysisFrame ( std::vector< std::string >  tokens)
private

Definition at line 1219 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetLiveFrame()

void ZMServer::handleGetLiveFrame ( std::vector< std::string >  tokens)
private

Definition at line 1389 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetFrameList()

void ZMServer::handleGetFrameList ( std::vector< std::string >  tokens)
private

Definition at line 1457 of file zmserver.cpp.

Referenced by processRequest().

◆ handleDeleteEvent()

void ZMServer::handleDeleteEvent ( std::vector< std::string >  tokens)
private

Definition at line 1616 of file zmserver.cpp.

Referenced by processRequest().

◆ handleDeleteEventList()

void ZMServer::handleDeleteEventList ( std::vector< std::string >  tokens)
private

Definition at line 1653 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetEventDates()

void ZMServer::handleGetEventDates ( std::vector< std::string >  tokens)
private

Definition at line 914 of file zmserver.cpp.

Referenced by processRequest().

◆ handleRunZMAudit()

void ZMServer::handleRunZMAudit ( void  )
private

Definition at line 1688 of file zmserver.cpp.

Referenced by processRequest().

◆ handleSetMonitorFunction()

void ZMServer::handleSetMonitorFunction ( std::vector< std::string >  tokens)
private

Definition at line 1942 of file zmserver.cpp.

Referenced by processRequest().

◆ zmcControl()

void ZMServer::zmcControl ( MONITOR monitor,
const std::string &  mode 
)
private

Definition at line 2045 of file zmserver.cpp.

Referenced by handleSetMonitorFunction().

◆ zmaControl()

void ZMServer::zmaControl ( MONITOR monitor,
const std::string &  mode 
)
private

Definition at line 2090 of file zmserver.cpp.

Referenced by handleSetMonitorFunction().

Member Data Documentation

◆ m_debug

bool ZMServer::m_debug {false}
private

◆ m_sock

int ZMServer::m_sock {-1}
private

Definition at line 345 of file zmserver.h.

Referenced by send(), and ZMServer().

◆ m_monitors

std::vector<MONITOR *> ZMServer::m_monitors
private

◆ m_monitorMap

std::map<int, MONITOR *> ZMServer::m_monitorMap
private

◆ m_useDeepStorage

bool ZMServer::m_useDeepStorage {false}
private

Definition at line 348 of file zmserver.h.

Referenced by handleGetAnalysisFrame(), handleGetEventFrame(), and ZMServer().

◆ m_useAnalysisImages

bool ZMServer::m_useAnalysisImages {false}
private

Definition at line 349 of file zmserver.h.

Referenced by handleGetAnalysisFrame(), and ZMServer().

◆ m_eventFileFormat

std::string ZMServer::m_eventFileFormat
private

Definition at line 350 of file zmserver.h.

Referenced by handleGetAnalysisFrame(), handleGetEventFrame(), and ZMServer().

◆ m_analysisFileFormat

std::string ZMServer::m_analysisFileFormat
private

Definition at line 351 of file zmserver.h.

Referenced by handleGetAnalysisFrame(), and ZMServer().

◆ m_shmKey

key_t ZMServer::m_shmKey
private

Definition at line 352 of file zmserver.h.

Referenced by getMonitorList(), and ZMServer().

◆ m_mmapPath

std::string ZMServer::m_mmapPath
private

Definition at line 353 of file zmserver.h.

Referenced by getMonitorList(), and ZMServer().


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