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 auto addr = std::make_shared<Address>(this->
data_->root_storage_, this->
data_->root_type_);
88 addr->data_->parent_ = this->
data_;
89 addr->data_->descendant_order_ = idx;
90 addr->data_->actual_storage_ =
data_->actual_storage_->get_item(idx);
98 std::shared_ptr<AddressData> address_data =
data_;
99 while (address_data->parent_ != NULL) {
100 path.push_back(address_data->descendant_order_);
101 address_data = address_data->parent_;
105 if (path.size() == 0) {
109 const StorageBase * storage = address_data->root_storage_;
111 std::string address =
"";
112 int i = path.size()-1;
118 storage = storage->
get_item(path[i]);
121 address = address +
"/" + it->key_;
122 input_type = it->type_.get();
131 storage = storage->
get_item(path[i]);
133 address = address +
"/" + boost::lexical_cast<std::string>(path[i]);
150 : address_(
Address() ), record_type_()
165 THROW( ExcAccessorForNullStorage() << EI_AccessorName(
"Record") );
218 THROW( ExcAccessorForNullStorage() << EI_AccessorName(
"Tuple") );
254 THROW( ExcAccessorForNullStorage() << EI_AccessorName(
"AbstractRecord") );
301 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