/usr/include/root/Reflex/TypeTemplate.h is in libroot-core-dev 5.34.19+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 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 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 | // @(#)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_TypeTemplate
#define Reflex_TypeTemplate
// Include files
#include "Reflex/Kernel.h"
namespace Reflex {
// forward declarations
class Type;
class TypeTemplateName;
/**
* @class TypeTemplate TypeTemplate.h Reflex/TypeTemplate.h
* @author Stefan Roiser
* @date 2005-02-03
* @ingroup Ref
*/
class RFLX_API TypeTemplate {
public:
/** default constructor */
TypeTemplate(const TypeTemplateName * typeTemplateName = 0);
/** copy constructor */
TypeTemplate(const TypeTemplate &rh);
/** destructor */
~TypeTemplate();
/** assignment op */
TypeTemplate& operator=(const TypeTemplate &rh);
/**
* operator bool will return true if the type template is resolved
* @return true if type template is resolved
*/
operator bool() const;
/**
* operator == will return true if two type templates are the same
* @return true if type templates match
*/
bool operator ==(const TypeTemplate& rh) const;
/**
* ByName will return a type template corresponding to the argument name
* @param type template name to lookup
* @param nTemplateParams looks up the template family with this number of template parameters
* if it is set to 0, the first occurence of the template family name will be returned
* @return corresponding type template to name
*/
static TypeTemplate ByName(const std::string& name,
size_t nTemplateParams = 0);
/**
* Id will return a memory address which is a unique id for this type template
* @return unique id of this type template
*/
void* Id() const;
/**
* Name will return the Name of the template family and a list of
* all currently available instantiations
* @return template family Name with all instantiantion
*/
std::string Name(unsigned int mod = 0) const;
/**
* TemplateInstance_Begin returns the begin iterator of the instance container
* @return the begin iterator of the instance container
*/
Type_Iterator TemplateInstance_Begin() const;
/**
* TemplateInstance_End returns the end iterator of the instance container
* @return the end iterator of the instance container
*/
Type_Iterator TemplateInstance_End() const;
/**
* TemplateInstance_RBegin returns the rbegin iterator of the instance container
* @return the rbegin iterator of the instance container
*/
Reverse_Type_Iterator TemplateInstance_RBegin() const;
/**
* TemplateInstance_Rend returns the rend iterator of the instance container
* @return the rend iterator of the instance container
*/
Reverse_Type_Iterator TemplateInstance_REnd() const;
/**
* TemplateInstanceAt will return a pointer to the nth template instantion
* @param nth template instantion
* @return pointer to nth template instantion
*/
Type TemplateInstanceAt(size_t nth) const;
/**
* TemplateInstanceSize will return the number of template instantions for
* this template family
* @return number of template instantions
*/
size_t TemplateInstanceSize() const;
/**
* TemplateParameterDefaultAt will return the nth TemplateParameterAt default value as string
* @param nth template TemplateParameterAt
* @return default value of nth template TemplateParameterAt
*/
std::string TemplateParameterDefaultAt(size_t nth) const;
/**
* TemplateParameterDefault_Begin returns the begin of the container of template parameter default names
* @return begin of container of template parameter default names
*/
StdString_Iterator TemplateParameterDefault_Begin() const;
/**
* TemplateParameterDefault_End returns the end of the container of template parameter default names
* @return end of container of template parameter default names
*/
StdString_Iterator TemplateParameterDefault_End() const;
/**
* TemplateParameterDefault_RBegin returns the reverse begin of the container of template parameter default names
* @return reverse begin of container of template parameter default names
*/
Reverse_StdString_Iterator TemplateParameterDefault_RBegin() const;
/**
* TemplateParameterDefault_REnd returns the reverse end of the container of template parameter default names
* @return reverse end of container of template parameter default names
*/
Reverse_StdString_Iterator TemplateParameterDefault_REnd() const;
/**
* TemplateParameterNameAt will the Name of the nth TemplateParameterAt
* @param nth template TemplateParameterAt
* @return Name of nth template TemplateParameterAt
*/
std::string TemplateParameterNameAt(size_t nth) const;
/**
* TemplateParameterName_Begin returns the begin of the container of template parameter names
* @return begin of container of template parameter names
*/
StdString_Iterator TemplateParameterName_Begin() const;
/**
* TemplateParameterName_End returns the end of the container of template parameter names
* @return end of container of template parameter names
*/
StdString_Iterator TemplateParameterName_End() const;
/**
* TemplateParameterName_RBegin returns the reverse begin of the container of template parameter names
* @return reverse begin of container of template parameter names
*/
Reverse_StdString_Iterator TemplateParameterName_RBegin() const;
/**
* TemplateParameterName_REnd returns the reverse end of the container of template parameter names
* @return reverse end of container of template parameter names
*/
Reverse_StdString_Iterator TemplateParameterName_REnd() const;
/**
* TemplateParameterSize will return the number of template parameters
* @return number of template parameters
*/
size_t TemplateParameterSize() const;
/**
* TypeTemplateAt will return the nth type template defined
* @param nth type template
* @return nth type template
*/
static TypeTemplate TypeTemplateAt(size_t nth);
/**
* TypeTemplateSize will return the number of type templates defined
* @return number of defined type templates
*/
static size_t TypeTemplateSize();
/**
* TypeTemplate_Begin returns the begin iterator of the type template container
* @return begin iterator of type template container
*/
static TypeTemplate_Iterator TypeTemplate_Begin();
/**
* TypeTemplate_End returns the end iterator of the type template container
* @return end iterator of type template container
*/
static TypeTemplate_Iterator TypeTemplate_End();
/**
* TypeTemplate_Rbegin returns the rbegin iterator of the type template container
* @return rbegin iterator of type template container
*/
static Reverse_TypeTemplate_Iterator TypeTemplate_RBegin();
/**
* TypeTemplate_Rend returns the rend iterator of the type template container
* @return rend iterator of type template container
*/
static Reverse_TypeTemplate_Iterator TypeTemplate_REnd();
/**
* Unload will unload the dictionary information of a type template
*/
void Unload() const;
public:
/**
* AddTemplateInstance adds one TemplateInstanceAt of the template to the local container
* @param templateInstance the template TemplateInstanceAt
*/
void AddTemplateInstance(const Type& templateInstance) const;
private:
/**
* pointer to the type template implementation
* @link aggregation
* @supplierCardinality 1
* @clientCardinality 1
* @label type template impl
*/
const TypeTemplateName* fTypeTemplateName;
}; // class TypeTemplate
} // namespace Reflex
#include "Reflex/internal/TypeTemplateName.h"
#include "Reflex/internal/TypeTemplateImpl.h"
//-------------------------------------------------------------------------------
inline Reflex::TypeTemplate::TypeTemplate(const TypeTemplateName* typeTemplateName)
//-------------------------------------------------------------------------------
: fTypeTemplateName(typeTemplateName) {
}
//-------------------------------------------------------------------------------
inline Reflex::TypeTemplate::TypeTemplate(const TypeTemplate& rh)
//-------------------------------------------------------------------------------
: fTypeTemplateName(rh.fTypeTemplateName) {
}
//-------------------------------------------------------------------------------
inline Reflex::TypeTemplate::~TypeTemplate() {
}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
inline
Reflex::TypeTemplate&
Reflex::TypeTemplate::operator=(const TypeTemplate& rh) {
//-------------------------------------------------------------------------------
if (&rh != this) {
fTypeTemplateName = rh.fTypeTemplateName;
}
return *this;
}
//-------------------------------------------------------------------------------
inline
Reflex::TypeTemplate::operator bool() const {
//-------------------------------------------------------------------------------
if (this->fTypeTemplateName && this->fTypeTemplateName->fTypeTemplateImpl) {
return true;
}
return false;
}
//-------------------------------------------------------------------------------
inline bool
Reflex::TypeTemplate::operator ==(const TypeTemplate& rh) const {
//-------------------------------------------------------------------------------
return fTypeTemplateName == rh.fTypeTemplateName;
}
//-------------------------------------------------------------------------------
inline void*
Reflex::TypeTemplate::Id() const {
//-------------------------------------------------------------------------------
return (void*) fTypeTemplateName;
}
//-------------------------------------------------------------------------------
inline size_t
Reflex::TypeTemplate::TemplateInstanceSize() const {
//-------------------------------------------------------------------------------
if (*this) {
return fTypeTemplateName->fTypeTemplateImpl->TemplateInstanceSize();
}
return 0;
}
//-------------------------------------------------------------------------------
inline size_t
Reflex::TypeTemplate::TemplateParameterSize() const {
//-------------------------------------------------------------------------------
if (*this) {
return fTypeTemplateName->fTypeTemplateImpl->TemplateParameterSize();
}
return 0;
}
//-------------------------------------------------------------------------------
inline std::string
Reflex::TypeTemplate::TemplateParameterDefaultAt(size_t nth) const {
//-------------------------------------------------------------------------------
if (*this) {
return fTypeTemplateName->fTypeTemplateImpl->TemplateParameterDefaultAt(nth);
}
return "";
}
//-------------------------------------------------------------------------------
inline Reflex::StdString_Iterator
Reflex::TypeTemplate::TemplateParameterDefault_Begin() const {
//-------------------------------------------------------------------------------
if (*this) {
return fTypeTemplateName->fTypeTemplateImpl->TemplateParameterDefault_Begin();
}
return Dummy::StdStringCont().begin();
}
//-------------------------------------------------------------------------------
inline Reflex::StdString_Iterator
Reflex::TypeTemplate::TemplateParameterDefault_End() const {
//-------------------------------------------------------------------------------
if (*this) {
return fTypeTemplateName->fTypeTemplateImpl->TemplateParameterDefault_End();
}
return Dummy::StdStringCont().end();
}
//-------------------------------------------------------------------------------
inline Reflex::Reverse_StdString_Iterator
Reflex::TypeTemplate::TemplateParameterDefault_RBegin() const {
//-------------------------------------------------------------------------------
if (*this) {
return fTypeTemplateName->fTypeTemplateImpl->TemplateParameterDefault_RBegin();
}
return Dummy::StdStringCont().rbegin();
}
//-------------------------------------------------------------------------------
inline Reflex::Reverse_StdString_Iterator
Reflex::TypeTemplate::TemplateParameterDefault_REnd() const {
//-------------------------------------------------------------------------------
if (*this) {
return fTypeTemplateName->fTypeTemplateImpl->TemplateParameterDefault_REnd();
}
return Dummy::StdStringCont().rend();
}
//-------------------------------------------------------------------------------
inline std::string
Reflex::TypeTemplate::TemplateParameterNameAt(size_t nth) const {
//-------------------------------------------------------------------------------
if (*this) {
return fTypeTemplateName->fTypeTemplateImpl->TemplateParameterNameAt(nth);
}
return "";
}
//-------------------------------------------------------------------------------
inline Reflex::StdString_Iterator
Reflex::TypeTemplate::TemplateParameterName_Begin() const {
//-------------------------------------------------------------------------------
if (*this) {
return fTypeTemplateName->fTypeTemplateImpl->TemplateParameterName_Begin();
}
return Dummy::StdStringCont().begin();
}
//-------------------------------------------------------------------------------
inline Reflex::StdString_Iterator
Reflex::TypeTemplate::TemplateParameterName_End() const {
//-------------------------------------------------------------------------------
if (*this) {
return fTypeTemplateName->fTypeTemplateImpl->TemplateParameterName_End();
}
return Dummy::StdStringCont().end();
}
//-------------------------------------------------------------------------------
inline Reflex::Reverse_StdString_Iterator
Reflex::TypeTemplate::TemplateParameterName_RBegin() const {
//-------------------------------------------------------------------------------
if (*this) {
return fTypeTemplateName->fTypeTemplateImpl->TemplateParameterName_RBegin();
}
return Dummy::StdStringCont().rbegin();
}
//-------------------------------------------------------------------------------
inline Reflex::Reverse_StdString_Iterator
Reflex::TypeTemplate::TemplateParameterName_REnd() const {
//-------------------------------------------------------------------------------
if (*this) {
return fTypeTemplateName->fTypeTemplateImpl->TemplateParameterName_REnd();
}
return Dummy::StdStringCont().rend();
}
//-------------------------------------------------------------------------------
inline size_t
Reflex::TypeTemplate::TypeTemplateSize() {
//-------------------------------------------------------------------------------
return TypeTemplateName::TypeTemplateSize();
}
#endif // Reflex_TypeTemplate
|