/usr/include/root/Reflex/internal/MemberTemplateImpl.h is in libroot-core-dev 5.34.14-1build1.
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 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | // @(#)root/reflex:$Id$
// Author: Stefan Roiser 2004
// Copyright CERN, CH-1211 Geneva 23, 2004-2006, All rights reserved.
//
// Permission to use, copy, modify, and distribute this software for any
// purpose is hereby granted without fee, provided that this copyright and
// permissions notice appear in all copies and derivatives.
//
// This software is provided "as is" without express or implied warranty.
#ifndef Reflex_MemberTemplateImpl
#define Reflex_MemberTemplateImpl
// Include files
#include "Reflex/Kernel.h"
#include "Reflex/Scope.h"
#ifdef _WIN32
# pragma warning( push )
# pragma warning( disable : 4251 )
#endif
namespace Reflex {
// forward declarations
class Member;
class Scope;
class MemberTemplate;
class MemberTemplateName;
class FunctionMemberTemplateInstance;
/**
* @class MemberTemplateImpl MemberTemplateImpl.h Reflex/MemberTemplateImpl.h
* @author Stefan Roiser
* @date 2005-02-03
* @ingroup Ref
*/
class RFLX_API MemberTemplateImpl {
public:
/** default constructor */
MemberTemplateImpl(const char* templateName,
const Scope &scope,
const std::vector<std::string> ¶meterNames,
const std::vector<std::string>& parameterDefaults = std::vector<std::string>());
/** destructor */
virtual ~MemberTemplateImpl();
/**
* operator == will return true if two At templates are the same
* @return true if At templates match
*/
bool operator ==(const MemberTemplateImpl& rh) const;
/**
* TemplateInstance_Begin returns the begin iterator of the instance container
* @return the begin iterator of the instance container
*/
Member_Iterator TemplateInstance_Begin() const;
/**
* TemplateInstance_End returns the end iterator of the instance container
* @return the end iterator of the instance container
*/
Member_Iterator TemplateInstance_End() const;
/**
* TemplateInstance_RBegin returns the rbegin iterator of the instance container
* @return the rbegin iterator of the instance container
*/
Reverse_Member_Iterator TemplateInstance_RBegin() const;
/**
* TemplateInstance_Rend returns the rend iterator of the instance container
* @return the rend iterator of the instance container
*/
Reverse_Member_Iterator TemplateInstance_REnd() const;
/**
* instantion will return a pointer to the nth template instantion
* @param nth template instantion
* @return pointer to nth template instantion
*/
Member TemplateInstanceAt(size_t nth) const;
/**
* instantionSize will return the number of template instantions for
* this template family
* @return number of template instantions
*/
size_t TemplateInstanceSize() const;
/**
* TemplateParameterSize will return the number of template parameters
* @return number of template parameters
*/
size_t TemplateParameterSize() const;
/**
* TemplateParameterDefaultAt will return the nth FunctionParameterAt default value as string
* @param nth template FunctionParameterAt
* @return default value of nth template FunctionParameterAt
*/
std::string TemplateParameterDefaultAt(size_t nth) const;
StdString_Iterator TemplateParameterDefault_Begin() const;
StdString_Iterator TemplateParameterDefault_End() const;
Reverse_StdString_Iterator TemplateParameterDefault_RBegin() const;
Reverse_StdString_Iterator TemplateParameterDefault_REnd() const;
/**
* TemplateParameterNameAt will the Name of the nth FunctionParameterAt
* @param nth template FunctionParameterAt
* @return Name of nth template FunctionParameterAt
*/
std::string TemplateParameterNameAt(size_t nth) const;
StdString_Iterator TemplateParameterName_Begin() const;
StdString_Iterator TemplateParameterName_End() const;
Reverse_StdString_Iterator TemplateParameterName_RBegin() const;
Reverse_StdString_Iterator TemplateParameterName_REnd() const;
/**
* Return the member template API class corresponding to this member template impl
* @return corresponding member template
*/
MemberTemplate ThisMemberTemplate() const;
public:
/**
* AddTemplateInstance adds one TemplateInstanceAt of the template to the local container
* @param templateInstance the template TemplateInstanceAt
*/
void AddTemplateInstance(const Member& templateInstance) const;
private:
/**
* declaring scope of this member template
* @link aggregation
* @label member template scope
* @clientCardinality 1
* @supplierCardinality 1
*/
Scope fScope;
/**
* the class template instances
* @link aggregation
* @supplierCardinality 1..*
* @clientCardinality 1
* @label template instances
*/
mutable
std::vector<Member> fTemplateInstances;
/**
* container of function parameter template names
*/
mutable
std::vector<std::string> fParameterNames;
/**
* function parameter template default values
*/
mutable
std::vector<std::string> fParameterDefaults;
/**
* number of required template parameters
*/
size_t fReqParameters;
/**
* pointer back to the member template name
* @link aggregation
* @label member template name
* @supplierCardinality 1
* @clientCardinality 1
*/
MemberTemplateName* fMemberTemplateName;
}; // class MemberTemplateImpl
} // namespace Reflex
//-------------------------------------------------------------------------------
inline size_t
Reflex::MemberTemplateImpl::TemplateParameterSize() const {
//-------------------------------------------------------------------------------
return fParameterNames.size();
}
//-------------------------------------------------------------------------------
inline std::string
Reflex::MemberTemplateImpl::TemplateParameterDefaultAt(size_t nth) const {
//-------------------------------------------------------------------------------
if (nth < fParameterDefaults.size()) {
return fParameterDefaults[nth];
}
return "";
}
//-------------------------------------------------------------------------------
inline Reflex::StdString_Iterator
Reflex::MemberTemplateImpl::TemplateParameterDefault_Begin() const {
//-------------------------------------------------------------------------------
return fParameterDefaults.begin();
}
//-------------------------------------------------------------------------------
inline Reflex::StdString_Iterator
Reflex::MemberTemplateImpl::TemplateParameterDefault_End() const {
//-------------------------------------------------------------------------------
return fParameterDefaults.end();
}
//-------------------------------------------------------------------------------
inline Reflex::Reverse_StdString_Iterator
Reflex::MemberTemplateImpl::TemplateParameterDefault_RBegin() const {
//-------------------------------------------------------------------------------
return ((const std::vector<std::string> &)fParameterDefaults).rbegin();
}
//-------------------------------------------------------------------------------
inline Reflex::Reverse_StdString_Iterator
Reflex::MemberTemplateImpl::TemplateParameterDefault_REnd() const {
//-------------------------------------------------------------------------------
return ((const std::vector<std::string> &)fParameterDefaults).rend();
}
//-------------------------------------------------------------------------------
inline std::string
Reflex::MemberTemplateImpl::TemplateParameterNameAt(size_t nth) const {
//-------------------------------------------------------------------------------
if (nth < fParameterNames.size()) {
return fParameterNames[nth];
}
return "";
}
//-------------------------------------------------------------------------------
inline Reflex::StdString_Iterator
Reflex::MemberTemplateImpl::TemplateParameterName_Begin() const {
//-------------------------------------------------------------------------------
return fParameterNames.begin();
}
//-------------------------------------------------------------------------------
inline Reflex::StdString_Iterator
Reflex::MemberTemplateImpl::TemplateParameterName_End() const {
//-------------------------------------------------------------------------------
return fParameterNames.end();
}
//-------------------------------------------------------------------------------
inline Reflex::Reverse_StdString_Iterator
Reflex::MemberTemplateImpl::TemplateParameterName_RBegin() const {
//-------------------------------------------------------------------------------
return ((const std::vector<std::string> &)fParameterNames).rbegin();
}
//-------------------------------------------------------------------------------
inline Reflex::Reverse_StdString_Iterator
Reflex::MemberTemplateImpl::TemplateParameterName_REnd() const {
//-------------------------------------------------------------------------------
return ((const std::vector<std::string> &)fParameterNames).rend();
}
#ifdef _WIN32
# pragma warning( pop )
#endif
#endif // Reflex_MemberTemplateImpl
|