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