Registry.cxx File Reference

#include <map>
#include <iomanip>
#include "TBuffer.h"
#include "TObject.h"
#include "Registry.h"
#include "RegistryItem.h"
#include <Util/UtilStream.h>
#include <MessageService/MsgService.h>
#include <typeinfo>
#include <iostream>
#include <sstream>
#include <cassert>

Go to the source code of this file.

Defines

#define REGISTRY_SET(TYPE)
#define REGISTRY_GET(TYPE)
#define REGISTRY_GET_TYPE(NAME, RETTYPE, TYPE)

Functions

 CVSID ("$Id: Registry.cxx,v 1.52 2013/09/17 21:49:59 rhatcher Exp $")
static std::istream & bail (std::istream &is)

Define Documentation

#define REGISTRY_GET ( TYPE   ) 
Value:
bool Registry::Get(const char* key, TYPE & val) const           \
{                                                               \
    tRegMap::const_iterator mit = fMap.find(key);               \
    if (mit == fMap.end()) return false;                        \
    RegistryItemXxx<TYPE>* rix =                                \
        dynamic_cast<RegistryItemXxx<TYPE>*>(mit->second);      \
    if (rix == 0){                                              \
      MSG("Registry", Msg::kError) << "Key " << key             \
                                   << " does not have type "    \
                                   << #TYPE << " as required"   \
                                   << endl;                     \
      return false;                                             \
    }                                                           \
    val = *(rix->Get());                                        \
    return true;                                                \
}

Definition at line 311 of file Registry.cxx.

#define REGISTRY_GET_TYPE ( NAME,
RETTYPE,
TYPE   ) 
Value:
RETTYPE Registry::Get##NAME(const char* key) const                        \
{                                                                         \
    TYPE retval = 0;                                                      \
    if (Get(key,retval)) return retval;                                   \
    if (fErrorHandler) { fErrorHandler(); return 0; }                     \
    else {                                                                \
        MSG("Registry",Msg::kWarning)                                     \
            << "\nRegistry::GetTYPE: failed to get value for key \""      \
            << key << "\" from Registry \"" << this->GetName()            \
            << "\".  Aborting\n\n";                                       \
        bool must_get_a_value = false;                                    \
        assert(must_get_a_value);                                         \
        return 0;                                                         \
    }                                                                     \
}

Definition at line 358 of file Registry.cxx.

#define REGISTRY_SET ( TYPE   ) 

Definition at line 228 of file Registry.cxx.


Function Documentation

static std::istream& bail ( std::istream &  is  )  [static]

Definition at line 492 of file Registry.cxx.

References Msg::kWarning, and MSG.

Referenced by Registry::ReadStream().

00493 {
00494     MSG("Registry",Msg::kWarning)
00495         << "Registry::Read(istream&) stream corrupted\n";
00496     return is;
00497 }

CVSID ( "$Id: Registry.  cxx,
v 1.52 2013/09/17 21:49:59 rhatcher Exp $"   
)

Generated on 8 Jul 2019 for loon by  doxygen 1.6.1