33 #include <BESInternalError.h>
36 #include "CurlHandlePool.h"
37 #include "DmrppRequestHandler.h"
38 #include "DmrppD4Opaque.h"
47 DmrppD4Opaque::operator=(
const DmrppD4Opaque &rhs)
52 dynamic_cast<D4Opaque &
>(*this) = rhs;
54 dynamic_cast<DmrppCommon &
>(*this) = rhs;
60 void DmrppD4Opaque::insert_chunk(shared_ptr<Chunk> chunk)
63 const vector<unsigned long long> &chunk_shape = get_chunk_dimension_sizes();
64 if (chunk_shape.size() != 1)
throw BESInternalError(
"Opaque variables' chunks can only have one dimension.", __FILE__, __LINE__);
67 const vector<unsigned long long> &chunk_origin = chunk->get_position_in_array();
69 char *source_buffer = chunk->get_rbuf();
70 unsigned char *target_buffer = get_buf();
72 memcpy(target_buffer + chunk_origin[0], source_buffer, chunk_shape[0]);
75 void DmrppD4Opaque::read_chunks()
77 for (
auto chunk : get_immutable_chunks()) {
79 if (!is_filters_empty()){
80 chunk->filter_chunk(get_filters(), get_chunk_size_in_elements(), 1 );
101 if (!get_chunks_loaded())
104 if (read_p())
return true;
109 if (get_chunk_dimension_sizes().empty()) {
112 char *data = read_atomic(name());
124 DmrppD4Opaque::set_send_p(
bool state)
126 if (!get_attributes_loaded())
127 load_attributes(
this);
129 D4Opaque::set_send_p(state);
132 void DmrppD4Opaque::dump(ostream & strm)
const
134 strm << BESIndent::LMarg <<
"DmrppD4Opaque::dump - (" << (
void *)
this <<
")" << endl;
136 DmrppCommon::dump(strm);
137 D4Opaque::dump(strm);
138 strm << BESIndent::LMarg <<
"value: " <<
"----" << endl;
139 BESIndent::UnIndent();
exception thrown if internal error encountered