Apama  9.12.0.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
engine_client_cpp.hpp
Go to the documentation of this file.
1 /*
2  * engine_client_cpp.hpp
3  *
4  * $Copyright(c) 2002-2012 Progress Software Corporation and/or its subsidiaries and affiliates. All rights reserved.$
5  * $Copyright (c) 2013-2016 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.$
6  * Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG
7  *
8  * $Id: engine_client_cpp.hpp 286710 2016-07-19 06:34:03Z pgou $
9  */
10 
15 #ifndef ENGINE_CLIENT_CPP_HPP
16 #define ENGINE_CLIENT_CPP_HPP
17 
18 #include <AP_Types.h>
19 #include <AP_Platform.h>
20 #include <iostream>
21 #include <sstream>
22 #include <exception>
23 #include <iterator>
24 #include <algorithm>
25 #include <utility>
26 #include <string>
27 #include <assert.h>
28 #include <engine_client_c.h>
29 #include <iomanip>
30 #include <vector>
31 
32 
33 using std::pair;
34 
35 #undef ERROR
36 
37 namespace com {
38 
40 namespace apama {
41 
46  class AP_ENGINE_CLIENT_API EngineException : public std::exception
47  {
48  public:
50  EngineException(const char *message);
53 
55  EngineException& operator= (const EngineException& ce) {
56  EngineException(ce).swap(*this);
57  return *this;
58  }
59 
61  virtual ~EngineException() throw();
62 
69  virtual const char* what() const throw() { return m_message; }
70 
78  virtual const char* const* getWarnings() const { return m_warnings; }
79 
80  protected:
82  void swap(EngineException &);
84  const char* const* m_warnings;
85 
86  private:
88  char *m_message;
89  };
90 
91 
93  typedef enum {
112  } LogLevel;
113 
114 
120  AP_ENGINE_CLIENT_API void setLogLevel(LogLevel level);
121 
132  AP_ENGINE_CLIENT_API void setLogFile(const AP_char8* filename, bool truncate, bool utf8 = false);
133 
139  AP_ENGINE_CLIENT_API void setLogFD(int fd);
140 
145  AP_ENGINE_CLIENT_API void setLogMutex(void *mutex);
146 
151  AP_ENGINE_CLIENT_API void reOpenLog();
152 
153 
155  AP_ENGINE_CLIENT_API AP_char8* convertToUTF8(const AP_char8* s);
156 
158  AP_ENGINE_CLIENT_API AP_char8* convertFromUTF8(const AP_char8* s);
159 
163  AP_ENGINE_CLIENT_API void char8free(char *string);
164 
168  namespace event {
169 
178  class AP_ENGINE_CLIENT_API Event
179  {
180  friend AP_ENGINE_CLIENT_API Event* createEvent(const char* eventString, const char* channelString);
181  friend AP_ENGINE_CLIENT_API void deleteEvent(Event* ev);
182 
183  public:
190  virtual const char* getText() const = 0;
191 
200  virtual const char* getChannel() const = 0;
201 
212  virtual double getTime() const = 0;
213 
215  inline friend std::ostream& operator << (std::ostream& stream, const Event& obj) {
216  stream << obj.getText();
217  return stream;
218  }
220  inline friend std::ostream& operator << (std::ostream& stream, const Event* obj) {
221  stream << obj->getText();
222  return stream;
223  }
224 
225  private:
227  Event(const Event&);
229  Event& operator= (const Event&);
230 
231  protected:
233  Event();
235  virtual ~Event();
236  };
237 
238 
250  class AP_ENGINE_CLIENT_API EventSupplier
251  {
252  friend AP_ENGINE_CLIENT_API void deleteEventSupplier(EventSupplier* evsup);
253 
254  public:
264  virtual void disconnect() = 0;
265 
266  protected:
268  EventSupplier();
270  virtual ~EventSupplier();
271 
272  private:
276  EventSupplier& operator= (const EventSupplier&);
277  };
278 
279 
290  class AP_ENGINE_CLIENT_API EventConsumer
291  {
292  public:
305  virtual void sendEvents(const Event* const* events) = 0;
306 
307  protected:
309  EventConsumer();
311  virtual ~EventConsumer();
312 
313  private:
317  EventConsumer& operator= (const EventConsumer&);
318  };
319 
323  class AP_ENGINE_CLIENT_API DisconnectableEventConsumer : public EventConsumer
324  {
325  public:
333  virtual void disconnect(const char* reason) = 0;
334 
335  protected:
339  virtual ~DisconnectableEventConsumer();
340 
341  private:
346  };
347 
348 
359  AP_ENGINE_CLIENT_API Event* createEvent(const char* eventString, const char* channelString);
360 
366  AP_ENGINE_CLIENT_API void deleteEvent(Event* ev);
367 
368 
377  AP_ENGINE_CLIENT_API void deleteEventSupplier(EventSupplier* evsup);
378 
379  } // namespace event
380 
382  namespace engine {
383 
392  class AP_ENGINE_CLIENT_API MonitorScript
393  {
394  friend AP_ENGINE_CLIENT_API MonitorScript* createMonitorScript(const char* monitorString);
395  friend AP_ENGINE_CLIENT_API void deleteMonitorScript(MonitorScript* mon);
396 
397  public:
405  virtual const char* getText() const = 0;
406 
408  inline friend std::ostream& operator << (std::ostream& stream, const MonitorScript& obj) {
409  stream << obj.getText();
410  return stream;
411  }
413  inline friend std::ostream& operator << (std::ostream& stream, const MonitorScript* obj) {
414  stream << obj->getText();
415  return stream;
416  }
417 
418  private:
422  MonitorScript& operator= (const MonitorScript&);
423 
424  protected:
426  MonitorScript();
428  virtual ~MonitorScript();
429  };
430 
436  class AP_ENGINE_CLIENT_API EngineStatus
437  {
438  friend class EngineManagement; /* getStatus */
439 
440  public:
441 
447 #ifdef _MSC_VER
448 // needed or MSVC complains about the use of pair<string> here, even though it's all inlined
449 #pragma warning (disable : 4251)
450 #endif
451  class AP_ENGINE_CLIENT_API StatusIterator : public std::iterator<std::forward_iterator_tag, int>
452  {
453  public:
455  typedef pair<std::string, std::string> pair_t;
456 
458  explicit StatusIterator(const EngineStatus &es, bool end=false);
461  m_status(0),
462  m_opaqueState(0),
463  iterPair()
464  {}
467  {
468  if (m_status && m_opaqueState) m_status->disposeIterator(m_opaqueState);
469  }
471  StatusIterator operator++(int dummy/*@unused@*/)
472  {
473  StatusIterator current(*this);
474  ++(*this); //this->operator++() // prefix ++
475  return current;
476  }
478  StatusIterator& operator++();
480  bool operator==(const StatusIterator& ref) const
481  {
482  return (m_status == ref.m_status) &&
483  (((0 == m_opaqueState) && (0 == ref.m_opaqueState)) ||
484  (iterPair.first == ref.iterPair.first));
485  }
487  bool operator!=(const StatusIterator& ref) const { return !((*this)==ref); }
489  pair_t &operator*() { return iterPair; }
491  pair_t *operator->() { return &iterPair; }
493  bool valid() { return 0 != m_opaqueState; }
494 
497  : m_status(ref.m_status),
498  m_opaqueState(m_status->copyIterator(ref.m_opaqueState)),
499  iterPair(ref.iterPair)
500  {}
503  {
504  StatusIterator(other).swap(*this);
505  return *this;
506  }
507 
508  private:
510  void step();
512  void swap(StatusIterator &other)
513  {
514  std::swap(m_status, other.m_status);
515  std::swap(m_opaqueState, other.m_opaqueState);
516  std::swap(iterPair, other.iterPair);
517  }
518 
520  const EngineStatus *m_status;
522  void *m_opaqueState;
524  pair_t iterPair;
525  };
526 
531 
537  AP_uint64 getUptime() const {
538  return getStatusIntValue("uptime");
539  }
540 
546  AP_uint32 getNumContexts() const {
547  return (AP_uint32) getStatusIntValue("numContexts");
548  }
549 
555  AP_uint32 getNumMonitors() const {
556  return (AP_uint32) getStatusIntValue("numMonitors");
557  }
558 
565  AP_uint32 getNumProcesses() const {
566  return (AP_uint32) getStatusIntValue("numProcesses");
567  }
568 
574  AP_uint32 getNumJavaApplications() const {
575  return (AP_uint32) getStatusIntValue("numJavaApplications");
576  }
577 
583  AP_uint32 getNumListeners() const {
584  return (AP_uint32) getStatusIntValue("numListeners");
585  }
586 
592  AP_uint32 getNumEventTypes() const {
593  return (AP_uint32) getStatusIntValue("numEventTypes");
594  }
595 
602  AP_uint32 getNumQueuedFastTrack() const {
603  return (AP_uint32) getStatusIntValue("numQueuedFastTrack");
604  }
605 
612  AP_uint32 getNumQueuedInput() const {
613  return (AP_uint32) getStatusIntValue("numQueuedInput");
614  }
615 
621  AP_uint64 getNumReceived() const {
622  return getStatusIntValue("numReceived");
623  }
624 
630  AP_uint64 getNumFastTracked() const {
631  return getStatusIntValue("numFastTracked");
632  }
633 
639  AP_uint32 getNumConsumers() const {
640  return (AP_uint32) getStatusIntValue("numConsumers");
641  }
642 
648  AP_uint32 getNumOutEventsQueued() const {
649  return (AP_uint32) getStatusIntValue("numOutEventsQueued");
650  }
651 
658  AP_uint64 getNumOutEventsCreated() const {
659  return getStatusIntValue("numEmits");
660  }
661 
669  AP_uint64 getNumOutEventsSent() const {
670  return getStatusIntValue("numOutEventsSent");
671  }
672 
678  AP_uint32 getNumInputQueuedInput() const {
679  return (AP_uint32) getStatusIntValue("numInputQueuedInput");
680  }
681 
687  const AP_char8* getMostBackedUpInput() const {
688  return (*this)["mostBackedUpInputContext"];
689  }
690 
696  const AP_char8 *getSlowestReceiver() const {
697  return (*this)["slowestReceiver"];
698  }
699 
705  AP_uint32 getSlowestReceiverQueueSize() const {
706  return (AP_uint32) getStatusIntValue("slowestReceiverQueueSize");
707  }
708 
714  AP_uint32 getMostBackedUpQueueSize() const {
715  return (AP_uint32) getStatusIntValue("mostBackedUpQueueSize");
716  }
717 
723  AP_uint32 getNumSubListeners() const {
724  return (AP_uint32) getStatusIntValue("numSubListeners");
725  }
726 
733  AP_uint64 getNumProcessed() const {
734  return getStatusIntValue("numProcessed");
735  }
742  const_iterator begin() const {
743  return StatusIterator(*this);
744  }
745 
752  const_iterator end() const {
753  return StatusIterator(*this, true);
754  }
755 
759  const AP_char8* operator[] (const char *ref) const {
760  return getStatusValue(ref);
761  }
762 
766  const AP_char8* operator[] (std::string &ref) const {
767  return this->operator[](ref.c_str());
768  }
769 
776  AP_int64 getUserInt(const char* key) {
777  return userInt(key);
778  }
779 
786  AP_int64 getUserIntOr(const char* key, int alt) {
787  return userIntOr(key, alt);
788  }
789 
796  AP_float64 getUserFloat(const char* key) {
797  return userFloat(key);
798  }
799 
806  AP_float64 getUserFloatOr(const char* key, float alt) {
807  return userFloatOr(key, alt);
808  }
809 
816  AP_bool getUserBool(const char* key) {
817  return userBool(key);
818  }
819 
826  AP_bool getUserBoolOr(const char* key, bool alt) {
827  return userBoolOr(key, alt);
828  }
829 
836  const AP_char8* getUserString(const char* key) {
837  return userString(key);
838  }
839 
846  const AP_char8* getUserStringOr(const char* key, const char* alt) {
847  return userStringOr(key, alt);
848  }
849 
855  std::string getAllStatusValues() {
856  std::ostringstream ost;
857  ost << getStandardStatusValues();
858  for (EngineStatus::StatusIterator it = begin(); it != end(); ++it) {
859  if (it->first.find("user-") != std::string::npos)
860  ost << std::setw(32) << setiosflags(std::ios_base::left) << it->first.append(":") << it->second << std::endl;
861  }
862  return ost.str();
863  }
864 
870  std::string getStandardStatusValues() {
871  std::ostringstream ost;
872  ost
873  << "Uptime(ms): " << getUptime() << std::endl
874  << "Number of contexts: " << getNumContexts() << std::endl
875  << "Number of monitors: " << getNumMonitors() << std::endl
876  << "Number of sub-monitors: " << getNumProcesses() << std::endl
877  << "Number of java applications: " << getNumJavaApplications() << std::endl
878  << "Number of listeners: " << getNumListeners() << std::endl
879  << "Number of sub-listeners: " << getNumSubListeners() << std::endl
880  << "Number of event types: " << getNumEventTypes() << std::endl
881  << "Events on input queue: " << getNumQueuedInput() << std::endl
882  << "Events received: " << getNumReceived() << std::endl
883  << "Events processed: " << getNumProcessed() << std::endl
884  << "Events on internal queue: " << getNumQueuedFastTrack() << std::endl
885  << "Events routed internally: " << getNumFastTracked() << std::endl
886  << "Number of consumers: " << getNumConsumers() << std::endl
887  << "Events on output queue: " << getNumOutEventsQueued() << std::endl
888  << "Output events created: " << getNumOutEventsCreated() << std::endl
889  << "Output events sent: " << getNumOutEventsSent() << std::endl
890  << "Events on input context queues: " << getNumInputQueuedInput() << std::endl
891  << "Slowest context name: " << getMostBackedUpInput() << std::endl
892  << "Slowest context queue size: " << getMostBackedUpQueueSize() << std::endl
893  << "Slowest receiver name: " << getSlowestReceiver() << std::endl
894  << "Slowest receiver queue size: " << getSlowestReceiverQueueSize() << std::endl;
895  return ost.str();
896  }
897 
903  static std::string getRawHeader() {
904  std::ostringstream ost;
905  ost << "Uptime (ms),# Contexts,# Monitors,# Sub-monitors,# Java apps,# Listeners,";
906  ost << "# Sub-listeners,# Event types,Input queue,# Received events,";
907  ost << "Route queue,# Routed events,# Consumers,Output queue,";
908  ost << "# Created output events,# Sent output events,# Processed events,";
909  ost << "Slowest context name,Slowest context queue size,Slowest receiver,Slowest receiver queue";
910  return ost.str();
911  }
912 
918  std::string getRawHeaderAll() {
919  std::ostringstream ost;
920  ost << getRawHeader();
921  for (EngineStatus::StatusIterator it = begin(); it != end(); ++it) {
922  if (it->first.find("user-") != std::string::npos)
923  ost << "," << it->first;
924  }
925  return ost.str();
926  }
927 
934  std::ostringstream ost;
935  ost << getUptime()
936  << "," << getNumContexts()
937  << "," << getNumMonitors()
938  << "," << getNumProcesses()
939  << "," << getNumJavaApplications()
940  << "," << getNumListeners()
941  << "," << getNumSubListeners()
942  << "," << getNumEventTypes()
943  << "," << getNumQueuedInput()
944  << "," << getNumReceived()
945  << "," << getNumQueuedFastTrack()
946  << "," << getNumFastTracked()
947  << "," << getNumConsumers()
948  << "," << getNumOutEventsQueued()
949  << "," << getNumOutEventsCreated()
950  << "," << getNumOutEventsSent()
951  << "," << getNumProcessed()
952  << "," << getMostBackedUpInput()
953  << "," << getMostBackedUpQueueSize()
954  << "," << getSlowestReceiver()
955  << "," << getSlowestReceiverQueueSize();
956  return ost.str();
957  }
958 
964  std::string getAllStatusValuesRaw() {
965  std::ostringstream ost;
966  ost << getStandardStatusValuesRaw();
967  for (EngineStatus::StatusIterator it = begin(); it != end(); ++it) {
968  if (it->first.find("user-") != std::string::npos)
969  ost << "," << it->second;
970  }
971  return ost.str();
972  }
973 
977  inline friend std::ostream& operator << (std::ostream& stream, const EngineStatus& obj) {
978  std::ostringstream ost;
979  ost
980  << "Uptime(ms): " << obj.getUptime() << std::endl
981  << "Number of contexts: " << obj.getNumContexts() << std::endl
982  << "Number of monitors: " << obj.getNumMonitors() << std::endl
983  << "Number of sub-monitors: " << obj.getNumProcesses() << std::endl
984  << "Number of java applications: " << obj.getNumJavaApplications() << std::endl
985  << "Number of listeners: " << obj.getNumListeners() << std::endl
986  << "Number of sub-listeners: " << obj.getNumSubListeners() << std::endl
987  << "Number of event types: " << obj.getNumEventTypes() << std::endl
988  << "Events on input queue: " << obj.getNumQueuedInput() << std::endl
989  << "Events received: " << obj.getNumReceived() << std::endl
990  << "Events processed: " << obj.getNumProcessed() << std::endl
991  << "Events on internal queue: " << obj.getNumQueuedFastTrack() << std::endl
992  << "Events routed internally: " << obj.getNumFastTracked() << std::endl
993  << "Number of consumers: " << obj.getNumConsumers() << std::endl
994  << "Events on output queue: " << obj.getNumOutEventsQueued() << std::endl
995  << "Output events created: " << obj.getNumOutEventsCreated() << std::endl
996  << "Output events sent: " << obj.getNumOutEventsSent() << std::endl
997  << "Events on input context queues: " << obj.getNumInputQueuedInput() << std::endl
998  << "Slowest context name: " << obj.getMostBackedUpInput() << std::endl
999  << "Slowest context queue size: " << obj.getMostBackedUpQueueSize() << std::endl
1000  << "Slowest receiver name: " << obj.getSlowestReceiver() << std::endl
1001  << "Slowest receiver queue size: " << obj.getSlowestReceiverQueueSize() << std::endl;
1002  stream << ost.str();
1003  return stream;
1004  }
1005 
1009  inline friend std::ostream& operator << (std::ostream& stream, const EngineStatus* obj) {
1010  stream << *obj;
1011  return stream;
1012  }
1013 
1018  {
1019  if (c_status) {
1020  c_status->functions->deleteStatus(reinterpret_cast<AP_EngineStatus *>(c_status));
1021  }
1022  }
1025  : c_status(other.c_status ? reinterpret_cast<AP_EngineStatus_API*>(other.c_status->functions->copyStatus(reinterpret_cast<AP_EngineStatus *>(other.c_status))) : 0)
1026  {}
1029  {
1030  EngineStatus(other).swap(*this);
1031  return *this;
1032  }
1036  EngineStatus(): c_status(0) {}
1037  private:
1039  EngineStatus(AP_EngineStatus_API *api): c_status(api) {}
1041  void swap(EngineStatus &other) {
1042  std::swap(c_status, other.c_status);
1043  }
1045  void getNext(const char *&name, const char *&value, void *&opaqueState) const {
1046  if (c_status)
1047  c_status->functions->getNextStatusItem(reinterpret_cast<AP_EngineStatus *>(c_status), &name, &value, &opaqueState);
1048  }
1050  const AP_char8* getStatusValue(const char *name) const {
1051  return c_status->functions->getStatusValue(reinterpret_cast<AP_EngineStatus *>(c_status), name);
1052  }
1054  AP_uint64 getStatusIntValue(const char *name) const {
1055  return c_status->functions->getStatusIntValue(reinterpret_cast<AP_EngineStatus *>(c_status), name);
1056  }
1058  void disposeIterator(void *opaqueState) const {
1059  c_status->functions->disposeIterator(reinterpret_cast<AP_EngineStatus *>(c_status), opaqueState);
1060  }
1062  void *copyIterator(void *opaqueState) const {
1063  return c_status->functions->copyIterator(reinterpret_cast<AP_EngineStatus *>(c_status), opaqueState);
1064  }
1065 
1067  AP_int64 userIntOr(const char* key, AP_int64 alt) {
1068  return c_status->functions->getUserIntOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
1069  }
1071  AP_float64 userFloatOr(const char* key, AP_float64 alt) {
1072  return c_status->functions->getUserFloatOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
1073  }
1075  AP_bool userBoolOr(const char* key, AP_bool alt) {
1076  return c_status->functions->getUserBoolOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
1077  }
1079  const AP_char8* userStringOr(const char* key, const AP_char8* alt) {
1080  return c_status->functions->getUserStringOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
1081  }
1083  AP_int64 userInt(const char* key) {
1084  return c_status->functions->getUserInt(reinterpret_cast<AP_EngineStatus *>(c_status), key);
1085  }
1087  AP_float64 userFloat(const char* key) {
1088  return c_status->functions->getUserFloat(reinterpret_cast<AP_EngineStatus *>(c_status), key);
1089  }
1091  AP_bool userBool(const char* key) {
1092  return c_status->functions->getUserBool(reinterpret_cast<AP_EngineStatus *>(c_status), key);
1093  }
1095  const AP_char8* userString(const char* key) {
1096  return c_status->functions->getUserString(reinterpret_cast<AP_EngineStatus *>(c_status), key);
1097  }
1099  AP_EngineStatus_API *c_status;
1100  };
1101 
1102  inline EngineStatus::StatusIterator::StatusIterator(const EngineStatus &es, bool end):
1103  m_status(&es),
1104  m_opaqueState(0),
1105  iterPair()
1106  {
1107  if (!end) step(); // get the first item in the map
1108  }
1109 
1112  {
1113  if (m_opaqueState) step();// don't step past the end
1114  return *this;
1115  }
1116 
1117  inline void EngineStatus::StatusIterator::step()
1118  {
1119  const char *name = 0;
1120  const char *value = 0;
1121 
1122  /* get the next item from the library map */
1123  m_status->getNext(name, value, m_opaqueState );
1124  if(!name || !value) {
1125  assert(!m_opaqueState);
1126  } else {
1127  iterPair = pair_t(name, value);
1128  }
1129  }
1130 
1141  class AP_ENGINE_CLIENT_API NameInfo
1142  {
1143  public:
1147  virtual const char* getName() const = 0;
1148 
1153  virtual const char* getPackage() const = 0;
1154 
1158  virtual const char* getFullyQualifiedName() const = 0;
1159 
1160  private:
1162  NameInfo(const NameInfo&);
1164  NameInfo& operator= (const NameInfo&);
1165 
1166  protected:
1168  NameInfo();
1170  virtual ~NameInfo();
1171  };
1172 
1177  class AP_ENGINE_CLIENT_API NamedMonitorInfo : public NameInfo
1178  {
1179  public:
1183  virtual unsigned int getNumSubMonitors() const = 0;
1184 
1185  private:
1190 
1191  protected:
1193  NamedMonitorInfo();
1195  virtual ~NamedMonitorInfo();
1196  };
1197 
1202  class AP_ENGINE_CLIENT_API NamedJavaApplicationInfo : public NameInfo {
1203 
1204  public:
1208  virtual unsigned int getNumListeners() const = 0;
1209 
1210  private:
1215 
1216  protected:
1220  virtual ~NamedJavaApplicationInfo();
1221  };
1222 
1227  class AP_ENGINE_CLIENT_API NamedContextInfo : public NameInfo {
1228 
1229  public:
1233  virtual unsigned int getNumSubMonitors() const = 0;
1234 
1238  virtual unsigned int getQueueSize() const = 0;
1239 
1243  virtual char const *const *getChannels() const = 0;
1244 
1245  private:
1250 
1251  protected:
1253  NamedContextInfo();
1255  virtual ~NamedContextInfo();
1256  };
1257 
1258 
1263  class AP_ENGINE_CLIENT_API NamedReceiverInfo : public NameInfo {
1264 
1265  public:
1269  virtual unsigned int getQueueSize() const = 0;
1270 
1274  virtual char const *const *getChannels() const = 0;
1275 
1279  virtual const AP_char8 *getAddress() const = 0;
1280 
1281  private:
1286 
1287  protected:
1291  virtual ~NamedReceiverInfo();
1292  };
1293 
1294 
1299  class AP_ENGINE_CLIENT_API NamedPluginReceiverInfo : public NameInfo {
1300 
1301  public:
1305  virtual unsigned int getQueueSize() const = 0;
1306 
1310  virtual char const *const *getChannels() const = 0;
1311 
1312  private:
1317 
1318  protected:
1322  virtual ~NamedPluginReceiverInfo();
1323  };
1324 
1329  class AP_ENGINE_CLIENT_API NamedEventTypeInfo : public NameInfo {
1330 
1331  public:
1335  virtual unsigned int getNumEventTemplates() const = 0;
1336 
1337  private:
1342 
1343  protected:
1347  virtual ~NamedEventTypeInfo();
1348  };
1349 
1354  class AP_ENGINE_CLIENT_API NamedTimerInfo : public NameInfo {
1355 
1356  public:
1360  virtual unsigned int getNumTimers() const = 0;
1361 
1362  private:
1367 
1368  protected:
1370  NamedTimerInfo();
1372  virtual ~NamedTimerInfo();
1373  };
1374 
1380  class AP_ENGINE_CLIENT_API NamedAggregateInfo : public NameInfo {
1381 
1382  private:
1387 
1388  protected:
1392  virtual ~NamedAggregateInfo();
1393  };
1394 
1407  class AP_ENGINE_CLIENT_API EngineInfo
1408  {
1409  friend AP_ENGINE_CLIENT_API void deleteInfo(EngineInfo* info);
1410 
1411  public:
1415  virtual unsigned int getNumMonitors() const = 0;
1416 
1420  virtual unsigned int getNumJavaApplications() const = 0;
1421 
1425  virtual unsigned int getNumEventTypes() const = 0;
1426 
1430  virtual unsigned int getNumTimers() const = 0;
1431 
1435  virtual unsigned int getNumAggregates() const = 0;
1436 
1444  virtual NamedMonitorInfo** getMonitors() const = 0;
1445 
1453  virtual NamedJavaApplicationInfo** getJavaApplications() const = 0;
1454 
1462  virtual NamedEventTypeInfo** getEventTypes() const = 0;
1463 
1471  virtual NamedTimerInfo** getTimers() const = 0;
1472 
1480  virtual NamedAggregateInfo** getAggregates() const = 0;
1481 
1485  virtual unsigned int getNumContexts() const = 0;
1486 
1494  virtual NamedContextInfo** getContexts() const = 0;
1495 
1499  virtual unsigned int getNumReceivers() const = 0;
1500 
1508  virtual NamedReceiverInfo **getReceivers() const = 0;
1509 
1513  virtual unsigned int getNumPluginReceivers() const = 0;
1514 
1522  virtual NamedPluginReceiverInfo **getPluginReceivers() const = 0;
1523 
1524  private:
1526  EngineInfo(const EngineInfo&);
1528  EngineInfo& operator= (const EngineInfo&);
1529 
1530  protected:
1532  EngineInfo();
1534  virtual ~EngineInfo();
1535  };
1536 
1537  class AP_ENGINE_CLIENT_API EngineConnection;
1538 
1555  class AP_ENGINE_CLIENT_API EngineManagement : public com::apama::event::EventConsumer
1556  {
1557  public:
1564  };
1571  virtual void injectMonitorScript(MonitorScript& script) = 0;
1572 
1588  virtual const char* const* injectMonitorScriptWithWarnings(MonitorScript& script) = 0;
1589 
1606  virtual const char* const* injectMonitorScriptWithWarningsFilename(MonitorScript& script, const char *filename) = 0;
1607 
1614  virtual void deleteName(const char * name) = 0;
1615 
1622  virtual void forceDeleteName(const char * name) = 0;
1623 
1630  virtual void killName(const char * name) = 0;
1631 
1635  virtual void deleteAll() = 0;
1636 
1645  virtual void injectJava(const AP_uint8* jarbytes, AP_uint32 size) = 0;
1646 
1663  virtual const char* const* injectJavaWithWarnings(const AP_uint8* jarbytes, AP_uint32 size) = 0;
1664 
1679  virtual const char* const* injectJavaWithWarningsFilename(const AP_uint8* jarbytes, AP_uint32 size, const char *filename) = 0;
1680 
1681 
1691  virtual void injectCDP(const AP_uint8* cdpbytes, AP_uint32 size, const char *filename=NULL) = 0;
1692 
1709  virtual const char* const* injectCDPWithWarnings(const AP_uint8* cdpbytes, AP_uint32 size) = 0;
1710 
1725  virtual const char* const* injectCDPWithWarningsFilename(const AP_uint8* cdpbytes, AP_uint32 size, const char *filename) = 0;
1726 
1732  {
1733  char *errmsg = 0;
1734  AP_EngineStatus *es_api = engineManagement_getStatusOpaque(this, &errmsg);
1735  if (errmsg) {
1736  com::apama::EngineException e(errmsg);
1737  free(errmsg);
1738  throw e;
1739  }
1740 
1741  return EngineStatus(reinterpret_cast<AP_EngineStatus_API *>(es_api));
1742  }
1743 
1767  virtual com::apama::event::EventSupplier* connectEventConsumer(com::apama::event::EventConsumer* consumer, const char* const* channels, bool disconnectSlow) = 0;
1768 
1785  virtual com::apama::event::EventSupplier* connectEventConsumer(com::apama::event::EventConsumer* consumer, const char* const* channels) = 0;
1786 
1809  virtual bool attachAsEventConsumerTo(EngineManagement* target, const char* const* channels, bool disconnectSlow = false, ConnectMode mode = CONNECT_LEGACY) = 0;
1810 
1811 
1834  virtual bool attachAsEventConsumerTo(const char* host, int port, const char* const* channels, bool disconnectSlow = false, ConnectMode mode = CONNECT_LEGACY) = 0;
1835 
1836 
1853  virtual void detachAsEventConsumerFrom(EngineManagement* target, const char* const* channels, ConnectMode mode = CONNECT_LEGACY) = 0;
1854 
1872  virtual void detachAsEventConsumerFrom(const char* host, int port, const char* const* channels, ConnectMode mode = CONNECT_LEGACY) = 0;
1873 
1884  virtual void sendEvents(const com::apama::event::Event* const* events) = 0;
1885 
1893  virtual void sendEventsNoBatching(const com::apama::event::Event* const* events) = 0;
1894 
1898  virtual void flushEvents() = 0;
1899 
1908  virtual EngineInfo* inspectEngine() = 0;
1909 
1926  virtual void ping() = 0;
1927 
1933  virtual bool isConnected() = 0;
1934 
1950  virtual void setReceiverConnections(const std::vector<com::apama::engine::EngineConnection>& connections) = 0;
1951 
1956  virtual const std::vector<com::apama::engine::EngineConnection> getReceiverConnections() = 0;
1957 
1958  protected:
1960  EngineManagement();
1962  virtual ~EngineManagement();
1963 
1964  private:
1969  };
1970 
1975  class AP_ENGINE_CLIENT_API EngineConnection {
1976  private:
1977  std::string host;
1978  int port;
1979  std::vector<std::string> channels;
1980  bool disconnectSlow;
1981  EngineManagement::ConnectMode connectMode;
1982 
1983  void init(const char * host, int port, bool disconnectSlow, EngineManagement::ConnectMode connectMode, const char * const * channels) {
1984  if (host == NULL || channels == NULL) {
1985  throw EngineException("EngineConnection cannot be created with null host or channels");
1986  }
1987  if (port < 0 || port > 65535) {
1988  throw EngineException("EngineConnection cannot be created with invalid port value");
1989  }
1990 
1991  this->host = std::string(host);
1992  this->port = port;
1993  this->disconnectSlow = disconnectSlow;
1994  this->connectMode = connectMode;
1995 
1996  for (const char* const* c = channels; *c != NULL; c++) {
1997  this->channels.push_back(std::string(*c));
1998  }
1999  }
2000 
2001  public:
2012  EngineConnection(const char * host, int port, bool disconnectSlow, EngineManagement::ConnectMode connectMode,
2013  const char * const * channels) {
2014  init(host, port, disconnectSlow, connectMode, channels);
2015  }
2016 
2024  EngineConnection(const char * host, int port, const char * const * channels) {
2025  init(host, port, false, EngineManagement::CONNECT_LEGACY, channels);
2026  }
2027 
2033  virtual const std::vector<std::string>& getChannels() const {
2034  return channels;
2035  }
2036 
2041  virtual const std::string& getHost() const {
2042  return host;
2043  }
2044 
2049  virtual int getPort() const {
2050  return port;
2051  }
2052 
2057  virtual bool getDisconnectSlow() const{
2058  return disconnectSlow;
2059  }
2060 
2066  return connectMode;
2067  }
2068 
2070  inline friend std::ostream& operator << (std::ostream& stream, const EngineConnection& obj) {
2071  std::ostringstream ost;
2072  ost << "EngineConnection to " << obj.host << ":" << obj.port << (obj.disconnectSlow == true ? " diconnectSlow" : "") << " on" <<
2073  (obj.connectMode == EngineManagement::CONNECT_PARALLEL ? " parallel" : "") << " channels [";
2074 
2075  if (!obj.channels.empty()) {
2076  std::copy(obj.channels.begin(), obj.channels.end() - 1, std::ostream_iterator<std::string>(ost, ", "));
2077  ost << obj.channels.back();
2078  }
2079  ost << "]";
2080  stream << ost.str();
2081  return stream;
2082  }
2083 
2085  inline friend std::ostream& operator << (std::ostream& stream, const EngineConnection* obj) {
2086  stream << *obj;
2087  return stream;
2088  }
2089 
2091  virtual ~EngineConnection() {
2092  }
2093  };
2094 
2101  AP_ENGINE_CLIENT_API void engineInit(const char* processName = "C++ Client");
2102 
2103 
2110  AP_ENGINE_CLIENT_API void engineInitMessaging(const char *processName, bool initMessaging=true);
2111 
2117  AP_ENGINE_CLIENT_API void engineShutdown();
2118 
2119 
2133  AP_ENGINE_CLIENT_API EngineManagement* connectToEngine(const char* host, unsigned short port, bool disconnectSlowReceiver = false);
2134 
2147  AP_ENGINE_CLIENT_API EngineManagement* connectToEngineReceiveOnly(const char* host, unsigned short port);
2148 
2160  AP_ENGINE_CLIENT_API EngineManagement* connectToEngineMonitorOnly(const char* host, unsigned short port);
2161 
2171  AP_ENGINE_CLIENT_API void disconnectFromEngine(EngineManagement* corr);
2172 
2179  AP_ENGINE_CLIENT_API MonitorScript* createMonitorScript(const char* monitorString);
2180 
2186  AP_ENGINE_CLIENT_API void deleteMonitorScript(MonitorScript* mon);
2187 
2197  AP_ENGINE_CLIENT_API void deleteInfo(EngineInfo* info);
2198 
2199 
2207  AP_ENGINE_CLIENT_API void deleteWarnings(const char* const* warnings);
2208 
2221  AP_ENGINE_CLIENT_API void setEngineParams(const char* params);
2222 
2223  } // namespace engine
2224 
2225 } // namespace apama
2226 
2227 } // namespace com
2228 
2229 
2230 #endif // ENGINE_CLIENT_CPP_HPP
AP_ENGINE_CLIENT_API void deleteInfo(EngineInfo *info)
This function allows deletion of an EngineInfo object.
AP_ENGINE_CLIENT_API void setLogLevel(LogLevel level)
Sets the level at which the client library will log information.
AP_ENGINE_CLIENT_API void setEngineParams(const char *params)
Set custom parameters for this instance of the client library.
Derived class from EventConsumer which implements the disconnect API.
Definition: engine_client_cpp.hpp:323
Base class for a named object (i.e.
Definition: engine_client_cpp.hpp:1141
const AP_char8 * getMostBackedUpInput() const
Get the name of the most backed up context.
Definition: engine_client_cpp.hpp:687
An EventConsumer can connect to the Engine through an EventSupplier and register to receive events...
Definition: engine_client_cpp.hpp:290
This is the header file for the Apama Engine C SDK.
AP_float64 getUserFloatOr(const char *key, float alt)
Get a user value of type AP_float64 or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:806
AP_ENGINE_CLIENT_API EngineManagement * connectToEngineMonitorOnly(const char *host, unsigned short port)
Attempt to establish a monitor-only connection to an Engine listening on the named host and port...
virtual const char * getText() const =0
Retrieve the event's type and its contents as a string.
AP_uint32 getNumConsumers() const
Get the number of event consumers connected to the engine.
Definition: engine_client_cpp.hpp:639
AP_ENGINE_CLIENT_API void engineInit(const char *processName="C++ Client")
This function must be called once per process first before any other Engine operations are carried ou...
AP_ENGINE_CLIENT_API EngineManagement * connectToEngineReceiveOnly(const char *host, unsigned short port)
Attempt to establish a receive-only connection to an Engine listening on the named host and port...
AP_uint32 getNumInputQueuedInput() const
Get the total number of events on input contexts' queues.
Definition: engine_client_cpp.hpp:678
virtual const char * getText() const =0
Retrieve the text of a MonitorScript fragment as a string.
~EngineStatus()
Destroy the underlying status data.
Definition: engine_client_cpp.hpp:1017
AP_uint32 getNumSubListeners() const
Get the number of active sub-listeners.
Definition: engine_client_cpp.hpp:723
EngineStatus getStatus()
Get the Engine's current operational status.
Definition: engine_client_cpp.hpp:1731
AP_int64 getUserIntOr(const char *key, int alt)
Get a user value of type AP_int64 or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:786
AP_uint64 getNumReceived() const
Get the number of events received since the Engine started.
Definition: engine_client_cpp.hpp:621
The Engine Management class acts as the interface to the Engine, and allows operations to be carried ...
Definition: engine_client_cpp.hpp:1555
bool operator==(const StatusIterator &ref) const
Returns true if two iterators point to the same item.
Definition: engine_client_cpp.hpp:480
virtual const std::vector< std::string > & getChannels() const
Get the channels associated with this connection.
Definition: engine_client_cpp.hpp:2033
virtual const std::string & getHost() const
Get the host associated with this connection.
Definition: engine_client_cpp.hpp:2041
pair< std::string, std::string > pair_t
element type
Definition: engine_client_cpp.hpp:455
Fatal messages.
Definition: engine_client_cpp.hpp:101
AP_ENGINE_CLIENT_API void deleteMonitorScript(MonitorScript *mon)
This function allows deletion of MonitorScript objects.
AP_int64 getUserInt(const char *key)
Get a user value of type AP_int64.
Definition: engine_client_cpp.hpp:776
EngineConnection encapsulates the information related to a connection between two Apama messaging com...
Definition: engine_client_cpp.hpp:1975
Nothing logged.
Definition: engine_client_cpp.hpp:95
AP_bool getUserBool(const char *key)
Get a user value of type AP_bool.
Definition: engine_client_cpp.hpp:816
AP_uint32 getNumJavaApplications() const
Get the number of Java (JMon) Applications defined in the Engine.
Definition: engine_client_cpp.hpp:574
Definition: sag_connectivity_threading.h:178
StatusIterator & operator=(const StatusIterator &other)
Copy assignment.
Definition: engine_client_cpp.hpp:502
Information about a timer type returned by an engine inspection.
Definition: engine_client_cpp.hpp:1354
AP_ENGINE_CLIENT_API AP_char8 * convertFromUTF8(const AP_char8 *s)
Convert a string in UTF-8 to the local encoding, since most of the Apama API returns UTF-8...
AP_uint32 getNumContexts() const
Get the number of contexts active in the Engine.
Definition: engine_client_cpp.hpp:546
Information about a context returned by an engine inspection.
Definition: engine_client_cpp.hpp:1227
StatusIterator operator++(int dummy)
(postfix) increment this iterator
Definition: engine_client_cpp.hpp:471
pair_t & operator*()
Return a reference to the element pointed to.
Definition: engine_client_cpp.hpp:489
std::string getStandardStatusValues()
Get the standard status values, formatted for terminal output.
Definition: engine_client_cpp.hpp:870
EngineConnection(const char *host, int port, bool disconnectSlow, EngineManagement::ConnectMode connectMode, const char *const *channels)
Definition: engine_client_cpp.hpp:2012
AP_ENGINE_CLIENT_API void engineInitMessaging(const char *processName, bool initMessaging=true)
This function (or engineInit) must be called once per process first before any other Engine operation...
Startup and other important messages.
Definition: engine_client_cpp.hpp:97
AP_uint32 getNumQueuedFastTrack() const
Get the total number of events waiting on the route queues (value of 'rq' in the correlator status li...
Definition: engine_client_cpp.hpp:602
EngineStatus & operator=(const EngineStatus &other)
Copy assignment.
Definition: engine_client_cpp.hpp:1028
AP_ENGINE_CLIENT_API MonitorScript * createMonitorScript(const char *monitorString)
This function allows creation of MonitorScript objects.
StatusIterator const_iterator
Iterator type for const EngineStatus.
Definition: engine_client_cpp.hpp:530
An EventSupplier represents the resources created by the Engine to service a connection to an externa...
Definition: engine_client_cpp.hpp:250
static std::string getRawHeader()
Get a header for the raw output, useful for indentifying values.
Definition: engine_client_cpp.hpp:903
const AP_char8 * getSlowestReceiver() const
Get the name of the slowest receiver.
Definition: engine_client_cpp.hpp:696
For backwards compatibility, single serial connection.
Definition: engine_client_cpp.hpp:1561
Information about a monitor returned by an engine inspection.
Definition: engine_client_cpp.hpp:1177
Allow parallel connections on multiple channels.
Definition: engine_client_c.h:1612
Information about a receiver returned by an engine inspection.
Definition: engine_client_cpp.hpp:1263
std::string getRawHeaderAll()
Get a header for the raw output, useful for indentifying values.
Definition: engine_client_cpp.hpp:918
AP_ENGINE_CLIENT_API void setLogFile(const AP_char8 *filename, bool truncate, bool utf8=false)
Sets the file to which the client library should log information.
ConnectMode
The mode that attachAsEventConsumerTo and detachAsEventConsumerFrom operate in.
Definition: engine_client_cpp.hpp:1559
For backwards compatibility, single serial connection.
Definition: engine_client_c.h:1610
EngineStatus()
Create a default-constructed (empty) EngineStatus.
Definition: engine_client_cpp.hpp:1036
Information messages (default)
Definition: engine_client_cpp.hpp:107
friend std::ostream & operator<<(std::ostream &stream, const EngineStatus &obj)
Stream output operator for a reference.
Definition: engine_client_cpp.hpp:977
Information about an aggregate function returned by an engine inspection.
Definition: engine_client_cpp.hpp:1380
EngineStatus.
Definition: engine_client_c.h:774
Allow parallel connections on multiple channels.
Definition: engine_client_cpp.hpp:1563
virtual const char *const * getWarnings() const
Retrieve the set of warnings associated with the exception.
Definition: engine_client_cpp.hpp:78
AP_uint32 getSlowestReceiverQueueSize() const
Get the queue size of the slowest receiver.
Definition: engine_client_cpp.hpp:705
Information about the monitors and types currently in an engine.
Definition: engine_client_cpp.hpp:1407
AP_ENGINE_CLIENT_API void engineShutdown()
This function must be called once per process before the application closes down. ...
Information about a java application returned by an engine inspection.
Definition: engine_client_cpp.hpp:1202
AP_ENGINE_CLIENT_API void disconnectFromEngine(EngineManagement *corr)
This function allows disconnection from an Engine.
const AP_char8 * getUserString(const char *key)
Get a user value of type AP_char8*.
Definition: engine_client_cpp.hpp:836
An Event object represents an event instance.
Definition: engine_client_cpp.hpp:178
AP_uint32 getNumMonitors() const
Get the number of monitors defined in the Engine.
Definition: engine_client_cpp.hpp:555
virtual bool getDisconnectSlow() const
Get the value of disconnectSlow flag associated with this connection.
Definition: engine_client_cpp.hpp:2057
Critical messages.
Definition: engine_client_cpp.hpp:99
AP_uint32 getMostBackedUpQueueSize() const
Get the queue size of the most backed up context.
Definition: engine_client_cpp.hpp:714
pair_t * operator->()
Return a pointer to the element pointed to.
Definition: engine_client_cpp.hpp:491
AP_uint64 getUptime() const
Get the time in ms that the Engine has been running for.
Definition: engine_client_cpp.hpp:537
const_iterator begin() const
Returns an instance of the StatusIterator which allows to iterate over all status items...
Definition: engine_client_cpp.hpp:742
virtual ~EngineConnection()
Destroy the underlying connection data.
Definition: engine_client_cpp.hpp:2091
std::string getAllStatusValuesRaw()
Get all the status values available, formatted for parsers (values separated by ,).
Definition: engine_client_cpp.hpp:964
AP_ENGINE_CLIENT_API void reOpenLog()
Re-opens the log file.
AP_uint32 getNumOutEventsQueued() const
Get the number of events waiting on the output queue.
Definition: engine_client_cpp.hpp:648
AP_uint32 getNumEventTypes() const
Get the number of event types defined in the Engine.
Definition: engine_client_cpp.hpp:592
LogLevel
Available logging levels.
Definition: engine_client_cpp.hpp:93
Information about a receiver returned by an engine inspection.
Definition: engine_client_cpp.hpp:1299
std::string getAllStatusValues()
Get all the status values available, formatted for terminal output.
Definition: engine_client_cpp.hpp:855
EngineStatus(const EngineStatus &other)
Copy constructor.
Definition: engine_client_cpp.hpp:1024
AP_uint32 getNumQueuedInput() const
Get the total number of events waiting on the input queues (value of 'iq' in the correlator status li...
Definition: engine_client_cpp.hpp:612
AP_uint64 getNumOutEventsSent() const
This is the number of output events sent out by the correlator process.
Definition: engine_client_cpp.hpp:669
AP_ENGINE_CLIENT_API void deleteWarnings(const char *const *warnings)
This function allows deletion of the lists of warnings returned by injectMonitorScriptWithWarnings()...
const_iterator end() const
Returns an instance of the StatusIterator which allows to iterate over all status items...
Definition: engine_client_cpp.hpp:752
virtual EngineManagement::ConnectMode getConnectMode() const
Get the connection mode associated with this connection.
Definition: engine_client_cpp.hpp:2065
EngineConnection(const char *host, int port, const char *const *channels)
Definition: engine_client_cpp.hpp:2024
EngineStatus represents the operational status of the Engine.
Definition: engine_client_cpp.hpp:436
AP_uint32 getNumListeners() const
Get the number of active listeners.
Definition: engine_client_cpp.hpp:583
AP_uint64 getNumOutEventsCreated() const
Get the number of output events which have been put onto the output queue.
Definition: engine_client_cpp.hpp:658
struct AP_EngineStatus_Stubs AP_EngineStatus
AP_EngineStatus allows access to the operational status of the Engine.
Definition: engine_client_c.h:128
Warning messages.
Definition: engine_client_cpp.hpp:105
AP_ENGINE_CLIENT_API AP_char8 * convertToUTF8(const AP_char8 *s)
Convert a string in local encoding to UTF-8, as required by most of the Apama API.
StatusIterator & operator++()
(prefix) increment this iterator
Definition: engine_client_cpp.hpp:1111
bool valid()
Returns true if this is a valid iterator over status data.
Definition: engine_client_cpp.hpp:493
const AP_char8 * getUserStringOr(const char *key, const char *alt)
Get a user value of type AP_char8* or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:846
AP_ENGINE_CLIENT_API Event * createEvent(const char *eventString, const char *channelString)
This function allows creation of an Event object.
Debugging messages.
Definition: engine_client_cpp.hpp:109
AP_float64 getUserFloat(const char *key)
Get a user value of type AP_float64.
Definition: engine_client_cpp.hpp:796
bool operator!=(const StatusIterator &ref) const
Returns false if two iterators point to the same item.
Definition: engine_client_cpp.hpp:487
Information about a event type returned by an engine inspection.
Definition: engine_client_cpp.hpp:1329
std::string getStandardStatusValuesRaw()
Get the standard status values, formatted for parsers (values separated by ,).
Definition: engine_client_cpp.hpp:933
StatusIterator()
Default-constructed status iterator.
Definition: engine_client_cpp.hpp:460
An EngineException is thrown by methods in this library if any problems are encountered.
Definition: engine_client_cpp.hpp:46
More-verbose debug messages.
Definition: engine_client_cpp.hpp:111
A MonitorScript object encapsulates a MonitorScript code fragment, containing package, event and monitor definitions to be injected into an Engine.
Definition: engine_client_cpp.hpp:392
AP_ENGINE_CLIENT_API void setLogFD(int fd)
Sets the file descriptor to which the client library should log information.
AP_ENGINE_CLIENT_API void char8free(char *string)
Free any char* string returned from the client API.
A class used for the iterating through all status items.
Definition: engine_client_cpp.hpp:451
AP_ENGINE_CLIENT_API void deleteEvent(Event *ev)
This function allows deletion of an Event object.
StatusIterator iterator
Iterator type.
Definition: engine_client_cpp.hpp:528
AP_ENGINE_CLIENT_API void deleteEventSupplier(EventSupplier *evsup)
This function disconnects and deletes an EventSupplier object.
AP_uint32 getNumProcesses() const
Get the number of monitor processes or active sub-monitors.
Definition: engine_client_cpp.hpp:565
AP_uint64 getNumProcessed() const
Get the number of events taken off the input queue and processed since the engine started...
Definition: engine_client_cpp.hpp:733
~StatusIterator()
Destroy underling status iterator.
Definition: engine_client_cpp.hpp:466
virtual int getPort() const
Get the port associated with this connection.
Definition: engine_client_cpp.hpp:2049
Error messages.
Definition: engine_client_cpp.hpp:103
StatusIterator(const StatusIterator &ref)
Copy constructor.
Definition: engine_client_cpp.hpp:496
AP_uint64 getNumFastTracked() const
Get the number of events received on the internal input queue since the Engine started.
Definition: engine_client_cpp.hpp:630
AP_ENGINE_CLIENT_API EngineManagement * connectToEngine(const char *host, unsigned short port, bool disconnectSlowReceiver=false)
This function attempts to establish a connection to an Engine.
AP_bool getUserBoolOr(const char *key, bool alt)
Get a user value of type AP_bool or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:826