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 mike 1.4 #include <Pegasus/Common/CIMReference.h>
|
36 mike 1.1 #include <Pegasus/Common/String.h>
37 #include <Pegasus/Common/Array.h>
38
39 PEGASUS_NAMESPACE_BEGIN
40
41 /** Maintains all associations for a given namesspace.
42 */
43 class PEGASUS_REPOSITORY_LINKAGE AssocTable
44 {
45 public:
46
47 /** Appends a row into the association table. There is no checking
|
48 mike 1.5 for duplicate entries (the caller ensures this). The case of
49 the arguments doesn't matter. They are ignored during comparison.
|
50 mike 1.1 */
51 static void append(
|
52 mike 1.3 PEGASUS_STD(ofstream)& os,
53 const String& assocInstanceName,
54 const String& assocClassName,
55 const String& fromObjectName,
56 const String& fromClassName,
57 const String& fromPropertyName,
58 const String& toObjectName,
59 const String& toClassName,
60 const String& toPropertyName);
61
62 /** Appends a row into the association table. There is no checking
|
63 mike 1.5 for duplicate entries (the caller ensures this). The case of the
64 arguments doesn't matter. Case is ignored during comparison.
|
65 mike 1.3 */
66 static void append(
|
67 mike 1.1 const String& path,
68 const String& assocInstanceName,
69 const String& assocClassName,
70 const String& fromObjectName,
71 const String& fromClassName,
72 const String& fromPropertyName,
73 const String& toObjectName,
74 const String& toClassName,
75 const String& toPropertyName);
76
77 /** Determines whether table contains an assoication entry for the given
78 object (either a class or an instance). This routine compares the
79 objectName parameter with the fromObjectName column.
80 @returns true if table contains the given object.
81 */
82 static Boolean containsObject(
83 const String& path,
|
84 mike 1.4 const CIMReference& objectName);
|
85 mike 1.1
86 /** Deletes the given association from the table by removing every entry
87 with an assocInstanceName equal to the assocInstanceName parameter.
88 @returns true if such an association was found.
89 */
90 static Boolean deleteAssociation(
91 const String& path,
|
92 mike 1.5 const CIMReference& assocInstanceName);
|
93 mike 1.1
94 /** Finds all associators of the given object. See
95 CIMOperations::associators() for a full description.
96 */
97 static Boolean getAssociatorNames(
98 const String& path,
|
99 mike 1.4 const CIMReference& objectName,
|
100 mike 1.1 const String& assocClass,
101 const String& resultClass,
102 const String& role,
103 const String& resultRole,
104 Array<String>& associatorNames);
105
106 /** Obtain all references (association instance names) in which the
107 given object is involved. See CIMOperations::associators() for a
108 full description.
109 */
110 static Boolean getReferenceNames(
111 const String& path,
|
112 mike 1.4 const CIMReference& objectName,
|
113 mike 1.1 const String& resultClass,
114 const String& role,
115 Array<String>& referenceNames);
|
116 mike 1.3
117 private:
118
119 AssocTable() { /* private */ }
|
120 mike 1.1 };
121
122 PEGASUS_NAMESPACE_END
123
124 #endif /* Pegasus_AssocTable_h */
|