IMP  2.0.0
The Integrative Modeling Platform
base/Object.h
Go to the documentation of this file.
1 /**
2  * \file IMP/base/Object.h
3  * \brief A shared base class to help in debugging and things.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPBASE_OBJECT_H
10 #define IMPBASE_OBJECT_H
11 
12 #include <IMP/base/base_config.h>
13 #include "declare_Object.h"
14 #include "object_cast.h"
15 #include <sstream>
16 
17 IMPBASE_BEGIN_NAMESPACE
18 #if !defined(IMP_DOXYGEN) && !defined(SWIG)
19 /** Send the whole show output to a stream*/
20 class ShowFull {
21  std::string showed_;
22  public:
23  ShowFull(Object *o){
24  std::ostringstream oss;
25  o->show(oss);
26  showed_=oss.str();
27  }
28  const std::string &get_string() const {return showed_;}
29 };
30 inline std::ostream &operator<<(std::ostream &o,
31  const ShowFull& sf) {
32  o << sf.get_string();
33  return o;
34 }
35 #endif
36 IMPBASE_END_NAMESPACE
37 
38 
39 #endif /* IMPBASE_OBJECT_H */