rwlogo
SourcePro 11.1

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWTraceMultiClientFilter Class Reference
[Execution Tracing]

A handle class for a trace event filter that accepts multiple clients. More...

#include <rw/trace/RWTraceMultiClientFilter.h>

Inheritance diagram for RWTraceMultiClientFilter:
RWTraceEventFilter RWTraceEventClient

List of all members.

Public Member Functions

 RWTraceMultiClientFilter (void)
 RWTraceMultiClientFilter (RWTraceMultiClientFilterImp *bodyP)
 RWTraceMultiClientFilter (RWStaticCtor)
 RWTraceMultiClientFilter (const RWTraceMultiClientFilter &second)
 ~RWTraceMultiClientFilter (void)

Detailed Description

RWTraceMultiClientFilter is a filter that accepts multiple clients and forwards trace events to them.

Examples

The following example creates two clients; one displays messages on the screen, and the other saves them to a file. This example can be found in examples/trace/example2.cpp.

 #define RW_USER_TRACE_LEVEL 8
 #include <rw\trace\trace.h>

 #include <fstream.h>

 int main()
 {
   ofstream traceLog("trace.log");
   RWTraceOstreamClient myFileTraceClient(traceLog);
   RWTraceOstreamClient myCerrTraceClient(cerr);

   RWTraceMultiClientFilter myMultiFilter;                  // 1

   // first: connect two clients to multi client filter
   myFileTraceClient.connect(myMultiFilter);                // 2
   myCerrTraceClient.connect(myMultiFilter);

   // last: connect filter to singleton manager
   myMultiFilter.connectToManager();                        // 3

   RW_USER_TRACEABLE_FUNCTION("main");                      // 4

   RW_USER_TRACE_DEBUG("Picked up pencil.");
   RW_USER_TRACE_TEST("Visual inspection of pencil complete.");
   RW_USER_TRACE_INFO("Doodling!");
   ...
   return 0;
 }

The following is a description of each program line:

//1 Instantiate the multi-client filter.

//2 First connect the two clients to the filter.

//3 Then connect the filter to the manager to ensure that no trace messages are lost.

//4 Generate some trace messages.


Constructor & Destructor Documentation

RWTraceMultiClientFilter::RWTraceMultiClientFilter ( void   ) 

Constructs an RWTraceMultiClientFilter (handle) and its body.

RWTraceMultiClientFilter::RWTraceMultiClientFilter ( RWTraceMultiClientFilterImp bodyP  ) 

Attaches to and increments the reference count on bodyP .

RWTraceMultiClientFilter::RWTraceMultiClientFilter ( RWStaticCtor   ) 

Constructs a global static handle instance (may be used before being constructed).

RWTraceMultiClientFilter::RWTraceMultiClientFilter ( const RWTraceMultiClientFilter second  ) 

Attaches to and increments the reference count on second 's body.

RWTraceMultiClientFilter::~RWTraceMultiClientFilter ( void   ) 

Destructor.


© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.