]> Creatis software - gdcm.git/blob - src/gdcmCommand.h
Fix mistypings
[gdcm.git] / src / gdcmCommand.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmCommand.h,v $
5   Language:  C++
6   Date:      $Date: 2007/08/22 16:14:03 $
7   Version:   $Revision: 1.4 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18
19 #ifndef _GDCMCOMMAND_H_
20 #define _GDCMCOMMAND_H_
21
22 #include "gdcmRefCounter.h"
23
24 namespace GDCM_NAME_SPACE 
25 {
26 //-----------------------------------------------------------------------------
27 class CommandManager;
28
29 //-----------------------------------------------------------------------------
30 /// Command list
31 enum CommandType {
32    CMD_UNKNOWN       =0,
33    CMD_DEBUG,
34    CMD_WARNING,
35    CMD_ERROR,
36    CMD_ASSERT,
37    CMD_STARTPROGRESS,
38    CMD_ENDPROGRESS,
39    CMD_PROGRESS
40 };
41
42 //-----------------------------------------------------------------------------
43 /**
44  * \brief Command base class to react on a gdcm event
45  *
46  * \remarks The execution parameter depends on the
47  */
48 class GDCM_EXPORT Command : public RefCounter
49 {
50    gdcmTypeMacro(Command);
51    gdcmNewMacro(Command);
52
53 public:
54
55    void SetType(unsigned int type);
56    unsigned int GetType() const;
57
58    void SetObject(Base *object);
59    Base *GetObject() const;
60    void SetConstObject(const Base *object);
61    const Base *GetConstObject() const;
62
63    void SetText(const std::string &text);
64    const std::string &GetText() const;
65
66    virtual void Execute();
67
68    static const char *GetCommandAsString(unsigned int command);
69
70 protected:
71    Command();
72    virtual ~Command();
73
74 private:
75    std::string Text;
76    Base *Object;
77    const Base *ConstObject;
78    unsigned int Cmd;
79 };
80 } // end namespace gdcm
81
82 //-----------------------------------------------------------------------------
83 #endif