Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / ASX / UPIPE_Event_Server / Event_Analyzer.cpp
blobe6364af591bd0484e525a46b0a465083f897ca76
1 #include "ace/OS_NS_string.h"
2 #include "ace/Truncate.h"
3 #include "Event_Analyzer.h"
6 #if defined (ACE_HAS_THREADS)
8 int
9 Event_Analyzer::open (void *)
11 return 0;
14 int
15 Event_Analyzer::close (u_long)
17 return 0;
20 int
21 Event_Analyzer::control (ACE_Message_Block *mb)
23 ACE_IO_Cntl_Msg *ioc = (ACE_IO_Cntl_Msg *) mb->rd_ptr ();
24 ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd;
26 switch (cmd = ioc->cmd ())
28 case ACE_IO_Cntl_Msg::SET_LWM:
29 case ACE_IO_Cntl_Msg::SET_HWM:
30 this->water_marks (cmd, *(size_t *) mb->cont ()->rd_ptr ());
31 break;
32 default:
33 break;
35 return 0;
38 int
39 Event_Analyzer::put (ACE_Message_Block *mb, ACE_Time_Value *)
41 if (mb->msg_type () == ACE_Message_Block::MB_IOCTL)
42 this->control (mb);
44 return this->put_next (mb);
47 int
48 Event_Analyzer::init (int, ACE_TCHAR *[])
50 return 0;
53 int
54 Event_Analyzer::fini ()
56 return 0;
59 int
60 Event_Analyzer::info (ACE_TCHAR **strp, size_t length) const
62 const ACE_TCHAR *module_name = this->name ();
64 if (*strp == 0 && (*strp = ACE_OS::strdup (module_name)) == 0)
65 return -1;
66 else
67 ACE_OS::strncpy (*strp, module_name, length);
69 return ACE_Utils::truncate_cast<int> (ACE_OS::strlen (module_name));
72 #endif /* ACE_HAS_THREADS */