IObject.hpp 2.7 KB
Newer Older
1
2
/**** This file has been autogenerated by gencastor from Umbrello UML model ***/

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/******************************************************************************
 *
 * 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.
 *
 * @author Castor Dev team, castor-dev@cern.ch
 *****************************************************************************/

24
#pragma once
25

26
#include "osdep.h"
Steven Murray's avatar
Steven Murray committed
27

28
29
30
31
32
33
34
35
36
37
#include <iostream>
#include <string>

namespace castor {

  // Forward declarations
  class ObjectSet;

  /**
   * class IObject
38
39
   * Base class for all objects
   * Implements the id methods
40
41
42
43
44
45
46
47
48
49
50
51
52
53
   */
  class IObject {

  public:

    /**
     * Empty Destructor
     */
    virtual ~IObject() throw() {};

    /**
     * Sets the id of the object
     * @param id The new id
     */
54
    virtual void setId(u_signed64 id) = 0;
55
56
57
58

    /**
     * gets the id of the object
     */
59
    virtual u_signed64 id() const = 0;
60
61
62
63
64
65

    /**
     * Gets the type of the object
     */
    virtual int type() const = 0;

66
67
68
69
70
    /**
     * virtual method to clone any object
     */
    virtual IObject* clone() = 0;

71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
    /**
     * Outputs this object in a human readable format
     * @param stream The stream where to print this object
     * @param indent The indentation to use
     * @param alreadyPrinted The set of objects already printed.
     * This is to avoid looping when printing circular dependencies
     */
    virtual void print(std::ostream& stream,
                       std::string indent,
                       castor::ObjectSet& alreadyPrinted) const = 0;

    /**
     * Outputs this object in a human readable format
     */
    virtual void print() const = 0;

87
  }; /* end of class IObject */
88

89
} /* end of namespace castor */
90

91
92
93
94
95
96
97
98
/**
 * outputs this IObject to an output stream
 * This method is actually not virtual as is always the case for
 * streaming operators. However, it makes use of the print method
 * which is pure virtual.
 */
std::ostream& operator<<(std::ostream& s, const castor::IObject& addr);