1 mike 1.1 //%/////////////////////////////////////////////////////////////////////////////
2 //
|
3 mike 1.3 // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM
|
4 mike 1.1 //
|
5 mike 1.3 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to
7 // deal in the Software without restriction, including without limitation the
8 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9 // sell copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
13 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
14 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
18 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20 mike 1.1 //
21 //==============================================================================
22 //
23 // Author: Mike Brasher (mbrasher@bmc.com)
24 //
25 // Modified By:
26 //
27 //%/////////////////////////////////////////////////////////////////////////////
28
29 #ifndef Pegasus_AssocTable_h
30 #define Pegasus_AssocTable_h
31
|
32 mike 1.3 #include <iostream>
33 #include <fstream>
|
34 mike 1.1 #include <Pegasus/Common/Config.h>
35 #include <Pegasus/Common/String.h>
36 #include <Pegasus/Common/Array.h>
37
38 PEGASUS_NAMESPACE_BEGIN
39
40 /** Maintains all associations for a given namesspace.
41 */
42 class PEGASUS_REPOSITORY_LINKAGE AssocTable
43 {
44 public:
45
46 /** Appends a row into the association table. There is no checking
47 for duplicate entries (the caller ensures this).
48 */
49 static void append(
|
50 mike 1.3 PEGASUS_STD(ofstream)& os,
51 const String& assocInstanceName,
52 const String& assocClassName,
53 const String& fromObjectName,
54 const String& fromClassName,
55 const String& fromPropertyName,
56 const String& toObjectName,
57 const String& toClassName,
58 const String& toPropertyName);
59
60 /** Appends a row into the association table. There is no checking
61 for duplicate entries (the caller ensures this).
62 */
63 static void append(
|
64 mike 1.1 const String& path,
65 const String& assocInstanceName,
66 const String& assocClassName,
67 const String& fromObjectName,
68 const String& fromClassName,
69 const String& fromPropertyName,
70 const String& toObjectName,
71 const String& toClassName,
72 const String& toPropertyName);
73
74 /** Determines whether table contains an assoication entry for the given
75 object (either a class or an instance). This routine compares the
76 objectName parameter with the fromObjectName column.
77 @returns true if table contains the given object.
78 */
79 static Boolean containsObject(
80 const String& path,
81 const String& objectName);
82
83 /** Deletes the given association from the table by removing every entry
84 with an assocInstanceName equal to the assocInstanceName parameter.
85 mike 1.1 @returns true if such an association was found.
86 */
87 static Boolean deleteAssociation(
88 const String& path,
89 const String& assocInstanceName);
90
91 /** Finds all associators of the given object. See
92 CIMOperations::associators() for a full description.
93 */
94 static Boolean getAssociatorNames(
95 const String& path,
96 const String& objectName,
97 const String& assocClass,
98 const String& resultClass,
99 const String& role,
100 const String& resultRole,
101 Array<String>& associatorNames);
102
103 /** Obtain all references (association instance names) in which the
104 given object is involved. See CIMOperations::associators() for a
105 full description.
106 mike 1.1 */
107 static Boolean getReferenceNames(
108 const String& path,
109 const String& objectName,
110 const String& resultClass,
111 const String& role,
112 Array<String>& referenceNames);
|
113 mike 1.3
114 private:
115
116 AssocTable() { /* private */ }
|
117 mike 1.1 };
118
119 PEGASUS_NAMESPACE_END
120
121 #endif /* Pegasus_AssocTable_h */
|