MessageAck.hpp 4.12 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/******************************************************************************
 *                      castor/MessageAck.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.
 *
 * @(#)$RCSfile$ $Revision$ $Release$ $Date$ $Author$
 *
 * 
 *
24
 * @author Castor Dev team, castor-dev@cern.ch
25
26
27
28
29
30
31
 *****************************************************************************/

#ifndef CASTOR_MESSAGEACK_HPP
#define CASTOR_MESSAGEACK_HPP

// Include Files
#include "castor/IObject.hpp"
32
#include "osdep.h"
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include <iostream>
#include <string>

namespace castor {

  // Forward declarations
  class ObjectSet;

  /**
   * class MessageAck
   * Acknowledgement message in the request handler protocol.
   */
  class MessageAck : public virtual IObject {

  public:

    /**
     * Empty Constructor
     */
    MessageAck() throw();

    /**
     * Empty Destructor
     */
    virtual ~MessageAck() throw();

    /**
     * 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;

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

    /**
     * Gets the type of this kind of objects
     */
    static int TYPE();

    /********************************************/
    /* Implementation of IObject abstract class */
    /********************************************/
    /**
     * Sets the id of the object
     * @param id The new id
     */
87
    virtual void setId(u_signed64 id);
88
89
90
91

    /**
     * gets the id of the object
     */
92
    virtual u_signed64 id() const;
93
94
95
96
97
98

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

99
100
101
102
103
    /**
     * virtual method to clone any object
     */
    virtual IObject* clone();

104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
    /*********************************/
    /* End of IObject abstract class */
    /*********************************/
    /**
     * Get the value of m_status
     * @return the value of m_status
     */
    bool status() const {
      return m_status;
    }

    /**
     * Set the value of m_status
     * @param new_var the new value of m_status
     */
    void setStatus(bool new_var) {
      m_status = new_var;
    }

    /**
     * Get the value of m_errorCode
     * @return the value of m_errorCode
     */
    int errorCode() const {
      return m_errorCode;
    }

    /**
     * Set the value of m_errorCode
     * @param new_var the new value of m_errorCode
     */
    void setErrorCode(int new_var) {
      m_errorCode = new_var;
    }

    /**
     * Get the value of m_errorMessage
     * @return the value of m_errorMessage
     */
    std::string errorMessage() const {
      return m_errorMessage;
    }

    /**
     * Set the value of m_errorMessage
     * @param new_var the new value of m_errorMessage
     */
    void setErrorMessage(std::string new_var) {
      m_errorMessage = new_var;
    }

  private:

  private:

    bool m_status;

    int m_errorCode;

    std::string m_errorMessage;

    /// The id of this object
166
    u_signed64 m_id;
167
168
169
170
171
172

  }; // end of class MessageAck

}; // end of namespace castor

#endif // CASTOR_MESSAGEACK_HPP