ROOT logo
// @(#)root/reflex:$Id: Any.cxx 22729 2008-03-19 10:20:10Z pcanal $
// 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_BUILD
#define REFLEX_BUILD
#endif

#include "Reflex/Any.h"
#include <string>
#include <iostream>

//-------------------------------------------------------------------------------
std::ostream & Reflex::operator << ( std::ostream& o, 
                                           const Any& any) {
//-------------------------------------------------------------------------------
// Puts the different any objects on the ostream.
   if      ( any.TypeInfo() == typeid(char) )   o << any_cast<char>(any);
   else if ( any.TypeInfo() == typeid(int) )    o << any_cast<int>(any);
   else if ( any.TypeInfo() == typeid(short) )  o << any_cast<short>(any);
   else if ( any.TypeInfo() == typeid(long) )   o << any_cast<long>(any);
   else if ( any.TypeInfo() == typeid(float) )  o << any_cast<float>(any);
   else if ( any.TypeInfo() == typeid(double) ) o << any_cast<double>(any);
   else if ( any.TypeInfo() == typeid(const char*) ) o << any_cast<const char*>(any);
   else if ( any.TypeInfo() == typeid(std::string) ) o << any_cast<std::string>(any); 
   else o << "Any object at " << std::hex << &static_cast<Any::Holder<int>*>(any.fContent)->fHeld;
   return o;
}
 Any.cxx:1
 Any.cxx:2
 Any.cxx:3
 Any.cxx:4
 Any.cxx:5
 Any.cxx:6
 Any.cxx:7
 Any.cxx:8
 Any.cxx:9
 Any.cxx:10
 Any.cxx:11
 Any.cxx:12
 Any.cxx:13
 Any.cxx:14
 Any.cxx:15
 Any.cxx:16
 Any.cxx:17
 Any.cxx:18
 Any.cxx:19
 Any.cxx:20
 Any.cxx:21
 Any.cxx:22
 Any.cxx:23
 Any.cxx:24
 Any.cxx:25
 Any.cxx:26
 Any.cxx:27
 Any.cxx:28
 Any.cxx:29
 Any.cxx:30
 Any.cxx:31
 Any.cxx:32
 Any.cxx:33
 Any.cxx:34
 Any.cxx:35