PEP 55 Update license on source files to current license text and date
[tpot/pegasus/.git] / src / Providers / linux / ProviderData / Interrupt / InterruptData.h
1 //%2003////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development
4 // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
6 // IBM Corp.; EMC Corporation, The Open Group.
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to
10 // deal in the Software without restriction, including without limitation the
11 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 // sell copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 // 
15 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
16 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
17 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
18 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 //
24 //==============================================================================
25 //
26 // Author: Christopher Neufeld <neufeld@linuxcare.com>
27 //         David Kennedy       <dkennedy@linuxcare.com>
28 //
29 // Modified By: David Kennedy       <dkennedy@linuxcare.com>
30 //              Christopher Neufeld <neufeld@linuxcare.com>
31 //              Al Stone            <ahs3@fc.hp.com>
32 //
33 //%////////////////////////////////////////////////////////////////////////////
34
35 #ifndef Pegasus_InterruptData_h
36 #define Pegasus_InterruptData_h
37
38 #include <Pegasus/Common/Config.h>
39 #include <Pegasus/Common/String.h>
40 #include <Pegasus/Common/CIMDateTime.h>
41 #include "ProviderData.h"
42 #include "DeviceLocator.h"
43 #include "InterruptInformation.h"
44
45 PEGASUS_NAMESPACE_BEGIN
46
47 /** InterruptData class.  This class is both a sort of iterator for 
48  *  all interrupts on the system as well as a wrapper for holding the
49  *  information of a specific interrupt.  */
50 class InterruptData : public ProviderData
51 {
52
53 public:
54    InterruptData(void);
55    ~InterruptData(void);
56
57    int initialize(void);
58    void terminate(void);
59
60    Array<InterruptData *> GetAllInterrupts(void);
61    InterruptData *GetFirstInterrupt(void);
62    InterruptData *GetNextInterrupt(void);
63    void EndGetInterrupt(void);
64    InterruptData *GetInterrupt(const String &inIrq);
65
66    String getIRQNumber() const;
67    String getAvailability() const;
68    String getTriggerType() const;
69
70    /** getTriggerLevel() is hardcoded to return unknown.  Linux can't
71     *  determine the trigger level.  */
72    String getTriggerLevel() const {return "2";};
73
74    /** getShareable() is hardcoded to return false.  */
75    String getShareable() const {return "FALSE";};
76
77    /** getHardware() is hardcoded to return true.  Linux does not
78    expose the software interrupts to userspace.  As a result, these
79    are all hardware interrupts. */
80    String getHardware() const {return "TRUE";};
81
82 private:
83
84    DeviceLocator deviceLocator;
85    InterruptInformation *irq;
86
87 };
88
89 PEGASUS_NAMESPACE_END
90
91 #endif