10 #include <boost/make_shared.hpp>
11 #include <boost/lexical_cast.hpp>
27 static std::string message(1024,
' ');
32 std::ostringstream converter;
34 converter << std::endl << std::endl;
35 converter <<
"--------------------------------------------------------" << std::endl;
36 converter <<
"User Error: ";
39 converter <<
"\n** Diagnosting info **\n" ;
40 converter << boost::diagnostic_information_what( *
this );
43 converter <<
"--------------------------------------------------------" << std::endl;
45 message = converter.str();
46 return message.c_str();
48 }
catch (std::exception &exc) {
49 std::cerr <<
"*** Exception encountered in exception handling routines ***" << std::endl <<
"*** Message is " << std::endl
50 << exc.what() << std::endl <<
"*** Aborting! ***" << std::endl;
54 std::cerr <<
"*** Exception encountered in exception handling routines ***" << std::endl <<
"*** Aborting! ***"
73 data_->root_type_ =
nullptr;
75 data_->parent_ =
nullptr;
76 data_->descendant_order_ = 0;
85 THROW( ExcAddressNullPointer() << EI_AccessorName(
"storage_root") );
87 THROW( ExcAddressNullPointer() << EI_AccessorName(
"type_root") );
89 data_->root_type_ = type_root;
90 data_->root_storage_ = storage_root;
91 data_->parent_ =
nullptr;
92 data_->descendant_order_ = 0;
93 data_->actual_storage_ = storage_root;
105 auto addr = std::make_shared<Address>(this->
data_->root_storage_, this->
data_->root_type_);
106 addr->data_->parent_ = this->
data_.get();
107 addr->data_->descendant_order_ = idx;
108 addr->data_->actual_storage_ =
data_->actual_storage_->get_item(idx);
117 while (address_data->
parent_ != NULL) {
119 address_data = address_data->
parent_;
123 if (path.size() == 0) {
129 std::string address =
"";
130 int i = path.size()-1;
136 storage = storage->
get_item(path[i]);
139 address = address +
"/" + it->key_;
140 input_type = it->type_.get();
149 storage = storage->
get_item(path[i]);
151 address = address +
"/" + boost::lexical_cast<std::string>(path[i]);
168 : record_type_(), address_(
Address() )
174 : record_type_(rec.record_type_), address_(rec.address_)
180 : record_type_(type), address_(address)
183 THROW( ExcAccessorForNullStorage() << EI_AccessorName(
"Record") );
210 : record_type_(), address_(
Address() )
216 : record_type_(rec.record_type_), address_(rec.address_)
222 : record_type_(type), address_(address)
225 THROW( ExcAccessorForNullStorage() << EI_AccessorName(
"AbstractRecord") );
231 {
return Record(address_,type()); }
264 for(
unsigned int i=0; i<vec_size; i++) {
265 result_storage->new_item(i, trans.get_item(i));
280 : array_type_(Type::Bool()), address_(
Address() )
285 : array_type_(ar.array_type_), address_(ar.address_)
290 : array_type_(type), address_(address)
293 THROW( ExcAccessorForNullStorage() << EI_AccessorName(
"Array") );
void print_stacktrace(std::ostream &out) const
Prints formated stacktrace into given stream out.
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
virtual void print_info(std::ostringstream &out) const =0