19 #include <boost/lexical_cast.hpp> 33 converter <<
"--------------------------------------------------------" << std::endl;
34 converter <<
"User Error: ";
36 #ifdef FLOW123D_DEBUG_MESSAGES 37 converter <<
"\n** Diagnosting info **\n" ;
38 converter << boost::diagnostic_information_what( *
this );
41 converter << std::endl <<
"--------------------------------------------------------" << std::endl;
57 data_->root_type_ =
nullptr;
59 data_->descendant_order_ = 0;
68 THROW( ExcAddressNullPointer() << EI_AccessorName(
"storage_root") );
70 THROW( ExcAddressNullPointer() << EI_AccessorName(
"type_root") );
72 data_->root_type_ = type_root;
73 data_->root_storage_ = storage_root;
74 data_->descendant_order_ = 0;
75 data_->actual_storage_ = storage_root;
87 && root_storage_ == actual_storage_
96 auto addr = std::make_shared<Address>(this->
data_->root_storage_, this->
data_->root_type_);
97 addr->data_->parent_ = this->
data_;
98 addr->data_->descendant_order_ = idx;
99 addr->data_->actual_storage_ =
data_->actual_storage_->get_item(idx);
107 std::shared_ptr<AddressData> address_data =
data_;
108 while (address_data->parent_ != NULL) {
109 path.push_back(address_data->descendant_order_);
110 address_data = address_data->parent_;
114 if (path.size() == 0) {
118 const StorageBase * storage = address_data->root_storage_;
120 std::string address =
"";
121 int i = path.size()-1;
127 storage = storage->
get_item(path[i]);
130 address = address +
"/" + it->key_;
131 input_type = it->type_.get();
140 storage = storage->
get_item(path[i]);
142 address = address +
"/" + boost::lexical_cast<std::string>(path[i]);
159 : address_(
Address() ), record_type_()
174 THROW( ExcAccessorForNullStorage() << EI_AccessorName(
"Record") );
227 THROW( ExcAccessorForNullStorage() << EI_AccessorName(
"Tuple") );
263 THROW( ExcAccessorForNullStorage() << EI_AccessorName(
"AbstractRecord") );
310 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