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

#include <appdynamics.h>

Inheritance diagram for appd::sdk::ExitCall:
appd::sdk::HandleWrapper< appd_exitcall_handle >

Public Member Functions

 ExitCall (BT &bt, const char *backend)
 
 ExitCall (BT &bt, const std::string &backend)
 
 ExitCall (appd_exitcall_handle exitcall)
 
 ~ExitCall ()
 
void store (const char *guid)
 
void store (const std::string &guid)
 
const std::string & get_correlation_header ()
 
int set_details (const char *details)
 
int set_details (const std::string &details)
 
virtual void add_error (enum appd_error_level level, const char *message, bool mark_bt_as_error=true)
 
- Public Member Functions inherited from appd::sdk::HandleWrapper< appd_exitcall_handle >
 HandleWrapper ()
 
 HandleWrapper (appd_exitcall_handle handle)
 
virtual ~HandleWrapper ()=default
 
appd_exitcall_handle handle ()
 
const appd_exitcall_handle handle () const
 
void add_error (enum appd_error_level level, const std::string &message, bool mark_bt_as_error=true)
 

Protected Member Functions

void init (BT &bt, const char *backend)
 

Private Member Functions

 ExitCall ()
 

Private Attributes

bool m_loaded_correlation_header
 
std::string correlation_header
 

Additional Inherited Members

- Protected Attributes inherited from appd::sdk::HandleWrapper< appd_exitcall_handle >
appd_exitcall_handle m_handle
 
bool m_borrowed_handle
 

Detailed Description

Represents an AppDynamics exit call as part of a business transaction.

As with appd::sdk::BT, this class allows automatically ending an exit call when it goes out of scope:

{
    appd::sdk::BT bt("compute");

    {
        appd::sdk::ExitCall db_call(bt, "primary-db");
        auto db = get_db_connection();
        db_call.set_details(query);
        db.execute(query, params);
    }  // exit call ends automatically

    // ... more that happens as part of the BT ...
}

For managing an exit call with a more complex lifetime, you are encouraged to look at a std::unique_ptr<appd::sdk::ExitCall> or std::shared_ptr<appd::sdk::ExitCall>.

You cannot copy an ExitCall.

Constructor & Destructor Documentation

◆ ExitCall() [1/4]

appd::sdk::ExitCall::ExitCall ( BT bt,
const char *  backend 
)
inline

Construct an object representing an ExitCall.

Parameters
btThe BT object that owns this exit call.
backendThe name of the registered backend this exit call talks to.

◆ ExitCall() [2/4]

appd::sdk::ExitCall::ExitCall ( BT bt,
const std::string &  backend 
)
inline

Construct an object representing an ExitCall.

Parameters
btThe BT object that owns this exit call.
backendThe name of the registered backend this exit call talks to.

◆ ExitCall() [3/4]

appd::sdk::ExitCall::ExitCall ( appd_exitcall_handle  exitcall)
inline

Construct an object wrapping the given exit call handle.

The handle is not owned by this object: the destructor will not call appd_exitcall_end on the given handle.

Parameters
exitcallAn exit call handle as returned by appd_exitcall_begin or appd_exitcall_get.

◆ ~ExitCall()

appd::sdk::ExitCall::~ExitCall ( )
inline

◆ ExitCall() [4/4]

appd::sdk::ExitCall::ExitCall ( )
private

Member Function Documentation

◆ add_error()

virtual void appd::sdk::ExitCall::add_error ( enum appd_error_level  level,
const char *  message,
bool  mark_bt_as_error = true 
)
inlinevirtual

Calls appd_exitcall_add_error on this exit call with the given error information.

Implements appd::sdk::HandleWrapper< appd_exitcall_handle >.

◆ get_correlation_header()

const std::string& appd::sdk::ExitCall::get_correlation_header ( )
inline

Calls appd_exitcall_get_correlation_header on this exit call.

◆ init()

void appd::sdk::ExitCall::init ( BT bt,
const char *  backend 
)
inlineprotected

◆ set_details() [1/2]

int appd::sdk::ExitCall::set_details ( const char *  details)
inline

Calls appd_exitcall_set_details on this exit call with the given information.

◆ set_details() [2/2]

int appd::sdk::ExitCall::set_details ( const std::string &  details)
inline

Calls appd_exitcall_set_details on this exit call with the given information.

◆ store() [1/2]

void appd::sdk::ExitCall::store ( const char *  guid)
inline

Calls appd_exitcall_store on this exit call with the given GUID.

◆ store() [2/2]

void appd::sdk::ExitCall::store ( const std::string &  guid)
inline

Calls appd_exitcall_store on this exit call with the given GUID.

Member Data Documentation

◆ correlation_header

std::string appd::sdk::ExitCall::correlation_header
private

◆ m_loaded_correlation_header

bool appd::sdk::ExitCall::m_loaded_correlation_header
private

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