Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / orbsvcs / performance-tests / RTEvent / lib / Servant_var.cpp
blobb67e7caabc87a351aa9cebfc6388be3ad5fda49c
1 /**
2 * @file Servant_var.cpp
4 * @author Jody Hagins <jody@atdesk.com>
5 * @author Carlos O'Ryan <coryan@uci.edu>
6 */
7 #ifndef TAO_PERF_RTEC_SERVANT_VAR_CPP
8 #define TAO_PERF_RTEC_SERVANT_VAR_CPP
10 #include "Servant_var.h"
11 #include "tao/Environment.h"
13 #if !defined(__ACE_INLINE__)
14 #include "Servant_var.inl"
15 #endif /* __ACE_INLINE__ */
17 template<class SERVANT>
18 Servant_var<SERVANT>::~Servant_var ()
20 if (this->ptr_ == 0)
21 return;
23 try{
24 this->ptr_->_remove_ref ();
25 } catch (const CORBA::Exception&) {
26 // @@ TODO This event should be logged. Cannot throw because that
27 // would make it impossible to use this class effectively.
29 // Suggested implementation:
31 // class Servant_Logger {
32 // public:
33 // static void log_error (void *servant_pointer)
34 // {
35 // if (Servant_Logger::instance_ == 0)
36 // return;
37 // Servant_Logger::instance_->logger_implementation (servant_pointer);
38 // }
39 // static Servant_Logger *set_instance (Servant_Logger*);
41 // virtual void logger_implementation (void *servant_pointer) = 0;
43 // private:
44 // static Servant_Logger *instance_;
45 // };
47 // Using an abstract class for logging decouples the code from any
48 // particular implementation, and provides a light-weight,
49 // high-performance solution for applications that want to avoid
50 // logging.
54 #endif /* TAO_PERF_RTEC_SERVANT_VAR_CPP */