summaryrefslogtreecommitdiff
path: root/ACE/TAO/DevGuideExamples/PortableInterceptors/PICurrent/Messenger_i.cpp
blob: c2f9473e3efaf222d0d041134ee919b12f3c7e30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* -*- C++ -*- $Id$ */

// ******  Code generated by the The ACE ORB (TAO) IDL Compiler *******
// TAO and the TAO IDL Compiler have been developed by the Center for
// Distributed Object Computing at Washington University, St. Louis.
//
// Information about TAO is available at:
//                 http://www.cs.wustl.edu/~schmidt/TAO.html

#include "Messenger_i.h"
#include "ace/OS_NS_time.h"
#if defined (ACE_HAS_STANDARD_CPP_LIBRARY) && (ACE_HAS_STANDARD_CPP_LIBRARY == 1)
#include <iostream>
#else
#include <iostream.h>
#endif

// Implementation skeleton constructor
Messenger_i::Messenger_i (void)
{
}

// Implementation skeleton destructor
Messenger_i::~Messenger_i (void)
{
}

CORBA::Boolean Messenger_i::send_message (
                                          const char * user_name,
                                          const char * subject,
                                          char *& message)

{
  //Add your implementation here
  std::cerr << "Message from: " << user_name << std::endl;
  std::cerr << "Subject:      " << subject << std::endl;
  std::cerr << "Message:      " << message << std::endl;
  return true;
}

char * Messenger_i::get_time (void)
{
  time_t thetime;
  struct tm * timeinfo = 0;

  ACE_OS::time(&thetime);
  timeinfo = ACE_OS::localtime(&thetime);
  char *timestring = CORBA::string_dup(ACE_OS::asctime(timeinfo));

  return timestring;
}