Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / DevGuideExamples / RTCORBA / Messenger_i.cpp
blob54a132d4978ecf0e49a8468d7c9aadc4ba8cde9b
1 #include "Messenger_i.h"
2 #include "ace/Thread.h"
3 #include <iostream>
5 // Implementation skeleton constructor
6 Messenger_i::Messenger_i(CORBA::ORB_ptr orb)
8 CORBA::Object_var obj = orb->resolve_initial_references("RTCurrent");
9 rt_current_ = RTCORBA::Current::_narrow(obj.in());
12 // Implementation skeleton destructor
13 Messenger_i::~Messenger_i()
17 CORBA::Boolean
18 Messenger_i::send_message (const char* user_name,
19 const char* subject,
20 char*& message)
22 CORBA::Short priority = rt_current_->the_priority();
24 ACE_hthread_t current;
25 ACE_Thread::self (current);
26 int native_priority;
28 std::cout << "Message from: " << user_name << std::endl
29 << "Subject: " << subject << std::endl
30 << "CORBA Priority: " << priority << std::endl;
31 if (ACE_Thread::getprio (current, native_priority) != -1) {
32 std::cout << "Native Priority: " << native_priority << std::endl;
34 std::cout << "Message: " << message << std::endl << std::endl;
35 return true;