This page is the front page for the documentation for the DRAMA 2 C++ interfaces to DRAMA.The core of DRAMA is written in C and was done well before C++ was available in a standard way on all the machines of interest. As a result, the C++ interfaces came later. There are a set of older C++ interfaces which have been distributed for some years, but which are a poor mapping to modern C++.
DRAMA2 provides a new C++ interface to DRAMA, interfaces which presume C++11 or later is available and makes extensive use of features of the upgraded compilers.
This documentation is generated automatically from the source code headers using the doxygen tool.
There is also a set of examples and a document describing how to use these interfaces - the document is the preferred way to learn DRAMA2. These are available in the AAO Module Drama2Examples. People outside the AAO can request these - please contact Tony Farrell
Below we have a quick introduction to each of the significant classes. There are various other minor classes and types.
- drama::sds::Id This is a class which provides an interface to the the DRAMA SDS Library. See the Self Definging Data System for full details on SDS itself. Of particular interest is that the C++ interface removes, in most cases, the need to tidy up SDS, by using C++ destructors. This class also implements creation of and access to typical DRAMA command argument structures, traditionally done with the Arg series of routines.
- drama::Parameter This class provides for creation of DRAMA Sdp parameters and access to those parameters
- drama::ParSys This class provides for more general access to DRAMA Sdp parameters, no reference to the creating class is needed.
- drama::Exception This is a class which is thrown as an exception any time the DRAMA C layers return an error to the C++ layers.
- drama::Task This class implements a DRAMA task. Running the constructor creates the task and methods within it allow you to run the task. Methods are provided to add Actions to the tasks.
- drama::EntryInfo This class is used to access details about an action entry (the action argument etc).
- drama::MessageHandler This class is an interface which must be implemented by task authors to implement their actions.
- drama::Spawnable This class is an interface which must be implemented by task authors to implement spawnable actions.
- drama::thread::TUface A class which can be used to allow non-action threads to send DRAMA messages and block waiting for their replies. This uses the DRAMA UFACE (User Interface) context, * as a typical use is the implementation of user interfaces.
- drama::thread::Monitor An abstract class used to implement DRAMA parameter monitors (monitoring of the change of the value of a parameter in another task.
- drama::thread::MonitorByType A concrete sub-class of drama::thread::Monitor which can be used to monitor parameters with particular methods invoked for each changes of the different parameter type. The user must sub-class this to handle parameter types of interest.
- drama::git::Task Create a DRAMA task which obeys the GIT (AAO Generic Instrumentation Task) specification. Such a task can be easily loaded and run by Standard AAO Control tasks. Clients should sub-class this to add their own actions and parameters.
- drama::git::Path A path for communicating with tasks that obey the GIT specification.
- drama::BulkData Defines and optionally creates a shared memory section for sending bulk data messages.
- drama::BulkDataSds Defines and optionally creates a shared memory section containing an SDS item.
- drama::BulkDataArgSds A class used to manage a bulk data argument to an action, which contains an SDS item.
- drama::gitarg::Bool A class used to read logical values from SDS argument structures typically used in DRAMA commands (e.g. as send by ditscmd).
- drama::gitarg::Enum A class used to read enumerated values from SDS argument structures typically used in DRAMA commands (e.g. as send by ditscmd).
- drama::gitarg::Int A class used to read integer values from SDS argument structures typically used in DRAMA commands (e.g. as send by ditscmd).
- drama::gitarg::Real A class used to read real number values from SDS argument structures typically used in DRAMA commands (e.g. as send by ditscmd).
- drama::gitarg::String A class used to read string values from SDS argument structures typically used in DRAMA commands (e.g. as send by ditscmd).
- drama::gitarg::Id A class used to read SDS ID values from SDS argument structures typically used in DRAMA commands. It can fetch its value from an Sds structure in the command argument or a file.
Other classes documented are generally used to support one of the above classes.
The "Hello World" example is included below, but the document and its examples from the Drama2Examples module is probably the best way to learn DRAMA2.
static const char *rcsId="@(#) $Id: ACMM:Drama2/examples/dramahello.cpp,v 1.45+ 22-Feb-2016 14:09:53+11 tjf $";
static void *use_rcsId = (0 ? (void *)(&use_rcsId) : (void *) &rcsId);
public:
HelloAction() {}
~HelloAction() {}
private:
if (Arg)
{
std::string MyArgument;
Arg.
Get(
"Argument1", &MyArgument);
}
}
};
private:
HelloAction HelloActionObj;
public:
DramaHello() :
drama::Task(
"DRAMAHELLO") {
}
~DramaHello() {
}
};
int main()
{
try
{
DramaHello task;
task.RunDrama();
}
{
fprintf(stderr,"DRAMA Exception thrown and caught in main\n");
fprintf(stderr,
"%s\n", e.
toString().c_str());
fprintf(stderr,"DRAMA Status = 0X%lx, %s\n",
}
return 0;
}
- Author
- Tony Farrell, AAO
- Revision
- 1.45
- Date
- 22-Feb-2016 14:09:53+11