19 #include <boost/make_shared.hpp> 20 #include <boost/lexical_cast.hpp> 34 converter <<
"--------------------------------------------------------" << std::endl;
35 converter <<
"User Error: ";
37 #ifdef FLOW123D_DEBUG_MESSAGES 38 converter <<
"\n** Diagnosting info **\n" ;
39 converter << boost::diagnostic_information_what( *
this );
42 converter << std::endl <<
"--------------------------------------------------------" << std::endl;
58 data_->root_type_ =
nullptr;
60 data_->descendant_order_ = 0;
69 THROW( ExcAddressNullPointer() << EI_AccessorName(
"storage_root") );
71 THROW( ExcAddressNullPointer() << EI_AccessorName(
"type_root") );
73 data_->root_type_ = type_root;
74 data_->root_storage_ = storage_root;
75 data_->descendant_order_ = 0;
76 data_->actual_storage_ = storage_root;
88 auto addr = std::make_shared<Address>(this->
data_->root_storage_, this->
data_->root_type_);
89 addr->data_->parent_ = this->
data_;
90 addr->data_->descendant_order_ = idx;
91 addr->data_->actual_storage_ =
data_->actual_storage_->get_item(idx);
99 boost::shared_ptr<AddressData> address_data =
data_;
100 while (address_data->parent_ != NULL) {
101 path.push_back(address_data->descendant_order_);
102 address_data = address_data->parent_;
106 if (path.size() == 0) {
110 const StorageBase * storage = address_data->root_storage_;
112 std::string address =
"";
113 int i = path.size()-1;
119 storage = storage->
get_item(path[i]);
122 address = address +
"/" + it->key_;
123 input_type = it->type_.get();
132 storage = storage->
get_item(path[i]);
134 address = address +
"/" + boost::lexical_cast<std::string>(path[i]);
151 : address_(
Address() ), record_type_()
166 THROW( ExcAccessorForNullStorage() << EI_AccessorName(
"Record") );
219 THROW( ExcAccessorForNullStorage() << EI_AccessorName(
"Tuple") );
255 THROW( ExcAccessorForNullStorage() << EI_AccessorName(
"AbstractRecord") );
302 THROW( ExcAccessorForNullStorage() << EI_AccessorName(
"Array") );
virtual void print_info(std::ostringstream &out) const =0
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.