BaseObject.hpp 2.28 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/******************************************************************************
 *                      BaseObject.hpp
 *
 * This file is part of the Castor project.
 * See http://castor.web.cern.ch/castor
 *
 * Copyright (C) 2003  CERN
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
20
 * @(#)$RCSfile: BaseObject.hpp,v $ $Revision: 1.2 $ $Release$ $Date: 2004/05/19 16:37:14 $ $Author: sponcec3 $
21
22
23
24
25
26
27
28
29
30
31
 *
 * Basic object support, including pointer to Services and log support
 *
 * @author Sebastien Ponce
 *****************************************************************************/

#ifndef CASTOR_BASEOBJECT_HPP 
#define CASTOR_BASEOBJECT_HPP 1

// Include Files
#include "castor/logstream.h"
32
#include "castor/exception/Exception.hpp"
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

namespace castor {

  // Forward Declarations
  class Services;
  class MsgSvc;

  /**
   * Basic object support, including pointer to Services and log support
   */
  class BaseObject {
    
  public:
    
    /**
     * Access to the underlying Services object
     */
50
    Services* svcs() throw(castor::exception::Exception);
51
52
53
54
55
56
57
    
    /**
     * gets the message service.
     * Note that the service has to be released after usage
     * @return a pointer to the message service or 0 if none
     * is available.
     */
58
    MsgSvc* msgSvc() throw(castor::exception::Exception);
59
60
61
62
    
    /**
     * Access to the log stream
     */
63
    castor::logstream& clog() throw(castor::exception::Exception);
64
65
66
67
68
69

  private:
    
    /**
     * gets the thread local storage
     */
70
    void getTLS(void** thip) throw(castor::exception::Exception);
71
72
73
74
75
76

  }; // end of class BaseObject

} // end of namespace castor  

#endif // CASTOR_BASEOBJECT_HPP