A.2.2 Creating the CADIBroker

This is the first step in creating a new simulation or connecting to an existing one.

This example shows the prototypes for the functions that create the CADIBroker:

Creating the CADIBroker
extern "C"
{
// Global function exported by a dynamically loaded object.
// This function must exist in a dynamically loaded object(DLL/.so).
// It allows the client to instantiate the CADIBroker.
CADI_WEXP eslapi::CADIBroker *CreateCADIBroker();
}

A prototype declaration enables a global function to instantiate a broker from a dynamically loaded object:

CADIBroker type declaration
typedef CADIBroker *(CreateCADIBroker_t)();

Clients must locate this symbol and cast it as a pointer to CreateCADIBroker_t:

// CreateCADIBroker_t
void *entry = lookup_symbol(dll, "CreateCADIBroker");
CADIBroker *broker = ((*CADIBroker::CreateCADIBroker_t)entry)();
Non-ConfidentialPDF file icon PDF version100963_0200_03_en
Copyright © 2014–2018 Arm Limited or its affiliates. All rights reserved.