/usr/include/classad/view.h is in libclassad-dev 8.6.8~dfsg.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | /***************************************************************
*
* Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
* University of Wisconsin-Madison, WI.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in compliance with the License. You may
* obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
***************************************************************/
#ifndef __CLASSAD_VIEW_H__
#define __CLASSAD_VIEW_H__
// STL includes
#include <string>
#include <set>
#include "classad/classad_stl.h"
#include "classad/exprTree.h"
#include "classad/matchClassad.h"
namespace classad {
// class declarations
class ExprTree;
class ClassAd;
class View;
class ClassAdCollection;
class ClassAdCollectionServer;
class ViewMember {
public:
ViewMember( );
ViewMember(const ViewMember &other);
~ViewMember( );
void SetKey( const std::string &key );
void SetRankValue( const Value &rankValue );
void GetKey( std::string &key ) const;
void GetRankValue( Value &rankValue ) const;
ViewMember operator=( const ViewMember& );
friend bool operator<(const ViewMember &vm1, const ViewMember &vm2);
private:
std::string key;
Value rank;
};
struct ViewMemberLT {
bool operator()( const ViewMember &vm1, const ViewMember &vm2 ) const;
};
typedef std::string ViewName;
typedef std::multiset<ViewMember, ViewMemberLT> ViewMembers;
typedef classad_slist<View*> SubordinateViews;
typedef classad_map<std::string,View*> PartitionedViews;
typedef classad_map<std::string,ViewMembers::iterator> MemberIndex;
/* View class */
class View {
public:
View( View *parent );
~View( );
// view control
bool SetViewName( const ViewName &viewName );
bool SetConstraintExpr( ClassAdCollection *coll,
const std::string &constraint );
bool SetConstraintExpr( ClassAdCollection *coll,
ExprTree *constraint );
bool SetRankExpr( ClassAdCollection *coll, const std::string &expr );
bool SetRankExpr( ClassAdCollection *coll, ExprTree *tree );
bool SetPartitionExprs( ClassAdCollection *coll,
const std::string &exprList );
bool SetPartitionExprs( ClassAdCollection *coll, ExprList *el );
bool SetViewInfo( ClassAdCollection *coll, ClassAd *viewInfo );
// view interrogation
inline ViewName GetViewName( ) const { return( viewName ); }
inline View *GetParent( ) const { return parent; }
inline int Size( ) const { return( (int)viewMembers.size( ) ); }
ExprTree *GetConstraintExpr( );
ExprTree *GetRankExpr( );
ExprList *GetPartitionAttributes( );
ClassAd *GetViewInfo( );
bool IsMember( const std::string &key );
void GetSubordinateViewNames( std::vector<std::string>& );
void GetPartitionedViewNames( std::vector<std::string>& );
bool FindPartition( ClassAd *rep, ViewName &partition );
// child view manipulation
bool InsertSubordinateView( ClassAdCollection *coll, ClassAd *vInfo );
bool InsertPartitionedView( ClassAdCollection *coll, ClassAd *vInfo,
ClassAd *rep );
bool DeleteChildView( ClassAdCollection *coll,
const ViewName &viewName );
bool DeleteSubordinateView( ClassAdCollection *coll,
const ViewName &viewName );
bool DeletePartitionedView( ClassAdCollection *coll,
const ViewName &viewName );
bool DeletePartitionedView( ClassAdCollection *coll, ClassAd *rep );
// classad manipulation
bool ClassAdInserted ( ClassAdCollection *coll,
const std::string &key, ClassAd *ad );
void ClassAdPreModify( ClassAdCollection *coll, ClassAd *ad );
bool ClassAdModified ( ClassAdCollection *coll,
const std::string &key, ClassAd *ad );
void ClassAdDeleted ( ClassAdCollection *coll,
const std::string &key, ClassAd *ad );
// misc
bool Display( FILE * );
/** An iterator we can use on a View */
typedef ViewMembers::iterator iterator;
/** A constant iterator we can use on a View */
typedef ViewMembers::const_iterator const_iterator;
/** Returns an iterator pointing to the beginning of the
attribute/value pairs in the View */
iterator begin() { return viewMembers.begin(); }
/** Returns a constant iterator pointing to the beginning of the
attribute/value pairs in the View */
const_iterator begin() const { return viewMembers.begin(); }
/** Returns aniterator pointing past the end of the
attribute/value pairs in the View */
iterator end() { return viewMembers.end(); }
/** Returns a constant iterator pointing past the end of the
attribute/value pairs in the View */
const_iterator end() const { return viewMembers.end(); }
private:
friend class ClassAdCollection;
friend class ClassAdCollectionServer;
friend class LocalCollectionQuery;
// private helper function
std::string makePartitionSignature( ClassAd *ad );
void DeleteView( ClassAdCollection * );
ViewName viewName; // name of the view
View *parent; // pointer to parent view
ViewMembers viewMembers; // the classads in this view
MemberIndex memberIndex; // keys->ViewMember mapping
PartitionedViews partitionedViews; // views created by partitioning
SubordinateViews subordinateViews; // views explicitly added
std::string oldAdSignature; // old signature of ad to be changed
MatchClassAd evalEnviron; // also stores view info
};
}
#endif // __CLASSAD_VIEW_H__
|