AppDynamics C/C++ SDK  21.3
Reference documentation for the C/C++ SDK.
appd::sdk::Event Class Reference

#include <appdynamics.h>

Public Member Functions

 Event (const std::string &applicationContext, appd_event_severity severity, const std::string &eventSubType, const std::string &summary, const std::map< std::string, std::string > &properties, const std::map< std::string, std::string > &details)
 
bool report ()
 

Private Member Functions

 Event ()=delete
 
 Event (const Event &)=delete
 

Private Attributes

bool m_success = true
 
appd_event_handle m_eventHandle = nullptr
 

Detailed Description

Represents an AppDynamics Event for C++ applications.

An instance of this class defines an event ( equivalent to calling appd_custom_event_start, appd_custom_event_add_property, and appd_custom_event_add_detail) upon construction. Then on this event object report() method should be invoked ( equivalent to calling appd_custom_event_end) to report the event.

A simple usage example is shown below:

{
  std::string applicationContext = "";
  appd_event_severity severity = APPD_EVENT_SEVERITY_INFO;
  std::string eventSubType = "category3";
  std::string summary = "This is a summary message.";
  std::map<std::string, std::string> properties;
  properties.emplace("propertyName", "propertyValue");
  std::map<std::string, std::string> details;
  details.emplace("detailName", "detailValue");

  appd::sdk::Event customEvent(applicationContext, severity, eventSubType, summary,
                               properties, details);
  bool success = customEvent.report();

  // other code
}

You cannot copy an Event.

Constructor & Destructor Documentation

◆ Event() [1/3]

appd::sdk::Event::Event ( const std::string &  applicationContext,
appd_event_severity  severity,
const std::string &  eventSubType,
const std::string &  summary,
const std::map< std::string, std::string > &  properties,
const std::map< std::string, std::string > &  details 
)
inline

Create a custom event object.

Parameters
applicationContextA string that contains the application context name for this custom event. If the application context is empty, then the default agent is picked.
severityEnum representing the severity for this custom event.
eventSubTypeA string that contains the custom event subtype. This subtype can be used in controller to filter the custom events belonging to a specific subtype.
summaryA string that contains the summary of what this custom event is about.
propertiesA map that contains the property-name as key and property-value as value. These property-name and property-values cannot be empty, but an empty map can be passed in if there are no properties to pass.
detailsA map that contains the detail-name as key and detail-value as value. These detail-name and detail-values cannot be empty, but an empty map can be passed in if there are no details to pass.

◆ Event() [2/3]

appd::sdk::Event::Event ( )
privatedelete

◆ Event() [3/3]

appd::sdk::Event::Event ( const Event )
privatedelete

Member Function Documentation

◆ report()

bool appd::sdk::Event::report ( )
inline

Report the custom event.

Returns
bool Returns true on successful reporting of the custom event. Otherwise, reports false.

Member Data Documentation

◆ m_eventHandle

appd_event_handle appd::sdk::Event::m_eventHandle = nullptr
private

◆ m_success

bool appd::sdk::Event::m_success = true
private

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