|
| 1 | +/* |
| 2 | + * (C) Copyright 1996- ECMWF. |
| 3 | + * |
| 4 | + * This software is licensed under the terms of the Apache Licence Version 2.0 |
| 5 | + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. |
| 6 | + * In applying this licence, ECMWF does not waive the privileges and immunities |
| 7 | + * granted to it by virtue of its status as an intergovernmental organisation nor |
| 8 | + * does it submit to any jurisdiction. |
| 9 | + */ |
| 10 | + |
| 11 | +#include "fdb5/parallax/ParallaxFieldLocation.h" |
| 12 | +#include "eckit/filesystem/URIManager.h" |
| 13 | +#include "fdb5/LibFdb5.h" |
| 14 | +#include "fdb5/parallax/ParallaxArray.h" |
| 15 | + |
| 16 | +namespace fdb5 |
| 17 | +{ |
| 18 | +::eckit::ClassSpec ParallaxFieldLocation::classSpec_ = { |
| 19 | + &FieldLocation::classSpec(), |
| 20 | + "ParallaxFieldLocation", |
| 21 | +}; |
| 22 | +::eckit::Reanimator<ParallaxFieldLocation> ParallaxFieldLocation::reanimator_; |
| 23 | + |
| 24 | +ParallaxFieldLocation::ParallaxFieldLocation(const ParallaxFieldLocation &rhs) |
| 25 | + : FieldLocation(rhs.uri_, rhs.offset_, rhs.length_, rhs.remapKey_) |
| 26 | +{ |
| 27 | +} |
| 28 | + |
| 29 | +ParallaxFieldLocation::ParallaxFieldLocation(const eckit::URI &uri, eckit::Offset offset, eckit::Length length, |
| 30 | + const Key &remapKey) |
| 31 | + : FieldLocation(uri, offset, length, remapKey) |
| 32 | +{ |
| 33 | +} |
| 34 | + |
| 35 | +ParallaxFieldLocation::ParallaxFieldLocation(eckit::Stream &s) |
| 36 | + : FieldLocation(s) |
| 37 | +{ |
| 38 | +} |
| 39 | + |
| 40 | +std::shared_ptr<FieldLocation> ParallaxFieldLocation::make_shared() const |
| 41 | +{ |
| 42 | + return std::make_shared<ParallaxFieldLocation>(std::move(*this)); |
| 43 | +} |
| 44 | + |
| 45 | +eckit::DataHandle *ParallaxFieldLocation::dataHandle() const |
| 46 | +{ |
| 47 | + return fdb5::ParallaxArrayName(uri_).dataHandle(offset(), length()); |
| 48 | +} |
| 49 | + |
| 50 | +void ParallaxFieldLocation::print(std::ostream &out) const |
| 51 | +{ |
| 52 | + out << "ParallaxFieldLocation[uri=" << uri_ << "]"; |
| 53 | +} |
| 54 | + |
| 55 | +void ParallaxFieldLocation::visit(FieldLocationVisitor &visitor) const |
| 56 | +{ |
| 57 | + visitor(*this); |
| 58 | +} |
| 59 | + |
| 60 | +} |
0 commit comments