Next: Sample C++ Application using "wildcarding" Up: Sample Applications Previous: Sample Code and "How-to's"

Sample C++ Application



  #include <cmlog.h>
  #include <cmlogFilter.h>
  #include <cmlogFilterSLAC.h>

...
  cmlogClient *client = cmlogClient::logClient();  // set up client connection

  cmlogFilterSLAC *filter = new cmlogFilterSLAC();	// create SLAC filter
  client -> setFilter (filter);			// install SLAC filter

  // set up first throttle
  filter -> setThrottle ("text",           // in field "text"
                         2,                // allow 2 messages
                         10.0,             // every 10 seconds
                         "agv");           // matching substring "agv"

  // set up second throttle
  filter -> setThrottle ("foo",            // in field "foo"
                         1,                // allow 1 message
                         60.0,             // every 60 seconds
                         (long)101);       // when its value == 101
...
  filter -> throttleShow ();               // display list of throttles
...
  filter -> throttleOff ();                // temporarily disable all throttles
...
  filter -> throttleOn ();                 // re-enable all throttles
...



James Silva
2002-10-28