IObject.hpp 2.71 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 <iostream>
27
#include <shift/osdep.h>
28
29
30
31
32
33
34
35
36
#include <string>

namespace castor {

  // Forward declarations
  class ObjectSet;

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

  public:

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

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

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

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

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

70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
    /**
     * 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;

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

88
} /* end of namespace castor */
89

90
91
92
93
94
95
96
97
/**
 * 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);