Include syntax "..." -> <dune/...>, changed boost::shared_ptr to std::tr1.
This commit is contained in:
parent
b021c8a1f0
commit
60deae5095
@ -42,9 +42,9 @@
|
||||
#include <cmath>
|
||||
#include <cfloat>
|
||||
#include <algorithm>
|
||||
#include "EclipseGridInspector.hpp"
|
||||
#include "EclipseGridParser.hpp"
|
||||
#include "SpecialEclipseFields.hpp"
|
||||
#include <dune/common/EclipseGridInspector.hpp>
|
||||
#include <dune/common/EclipseGridParser.hpp>
|
||||
#include <dune/common/SpecialEclipseFields.hpp>
|
||||
|
||||
namespace Dune
|
||||
{
|
||||
|
@ -231,7 +231,7 @@ void EclipseGridParser::readImpl(istream& is)
|
||||
// though (of course retaining the basic guarantee).
|
||||
map<string, vector<int> >& intmap = integer_field_map_;
|
||||
map<string, vector<double> >& floatmap = floating_field_map_;
|
||||
map<string, boost::shared_ptr<SpecialBase> >& specialmap = special_field_map_;
|
||||
map<string, tr1::shared_ptr<SpecialBase> >& specialmap = special_field_map_;
|
||||
|
||||
// Actually read the data
|
||||
is >> ignoreWhitespace;
|
||||
@ -249,7 +249,7 @@ void EclipseGridParser::readImpl(istream& is)
|
||||
readVectorData(is, floatmap[keyword]);
|
||||
break;
|
||||
case SpecialField: {
|
||||
boost::shared_ptr<SpecialBase> sb_ptr = createSpecialField(is, keyword);
|
||||
std::tr1::shared_ptr<SpecialBase> sb_ptr = createSpecialField(is, keyword);
|
||||
if (sb_ptr) {
|
||||
specialmap[keyword] = sb_ptr;
|
||||
} else {
|
||||
@ -307,7 +307,7 @@ void EclipseGridParser::readImpl(istream& is)
|
||||
std::cout << '\t' << i->first << '\n';
|
||||
|
||||
std::cout << "\nSpecial fields:\n";
|
||||
for (std::map<string, boost::shared_ptr<SpecialBase> >::iterator
|
||||
for (std::map<string, std::tr1::shared_ptr<SpecialBase> >::iterator
|
||||
i = specialmap.begin(); i != specialmap.end(); ++i)
|
||||
std::cout << '\t' << i->first << '\n';
|
||||
#endif
|
||||
@ -320,7 +320,7 @@ void EclipseGridParser::convertToSI()
|
||||
//---------------------------------------------------------------------------
|
||||
{
|
||||
// Convert all special fields.
|
||||
typedef std::map<string, boost::shared_ptr<SpecialBase> >::iterator SpecialIt;
|
||||
typedef std::map<string, std::tr1::shared_ptr<SpecialBase> >::iterator SpecialIt;
|
||||
for (SpecialIt i = special_field_map_.begin(); i != special_field_map_.end(); ++i) {
|
||||
i->second->convertToSI(units_);
|
||||
}
|
||||
@ -408,7 +408,7 @@ vector<string> EclipseGridParser::fieldNames() const
|
||||
}
|
||||
}
|
||||
{
|
||||
map<string, boost::shared_ptr<SpecialBase> >::const_iterator it = special_field_map_.begin();
|
||||
map<string, std::tr1::shared_ptr<SpecialBase> >::const_iterator it = special_field_map_.begin();
|
||||
for (; it != special_field_map_.end(); ++it) {
|
||||
names.push_back(it->first);
|
||||
}
|
||||
@ -459,10 +459,10 @@ const std::vector<double>& EclipseGridParser::getFloatingPointValue(const std::s
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
const boost::shared_ptr<SpecialBase> EclipseGridParser::getSpecialValue(const std::string& keyword) const
|
||||
const std::tr1::shared_ptr<SpecialBase> EclipseGridParser::getSpecialValue(const std::string& keyword) const
|
||||
//---------------------------------------------------------------------------
|
||||
{
|
||||
map<string, boost::shared_ptr<SpecialBase> >::const_iterator it = special_field_map_.find(keyword);
|
||||
map<string, std::tr1::shared_ptr<SpecialBase> >::const_iterator it = special_field_map_.find(keyword);
|
||||
if (it == special_field_map_.end()) {
|
||||
THROW("No such field: " << keyword);
|
||||
} else {
|
||||
@ -471,13 +471,13 @@ const boost::shared_ptr<SpecialBase> EclipseGridParser::getSpecialValue(const st
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
boost::shared_ptr<SpecialBase>
|
||||
std::tr1::shared_ptr<SpecialBase>
|
||||
EclipseGridParser::createSpecialField(std::istream& is,
|
||||
const std::string& fieldname)
|
||||
//---------------------------------------------------------------------------
|
||||
{
|
||||
string ukey = upcase(fieldname);
|
||||
boost::shared_ptr<SpecialBase> spec_ptr
|
||||
std::tr1::shared_ptr<SpecialBase> spec_ptr
|
||||
= Factory<SpecialBase>::createObject(fieldname);
|
||||
spec_ptr->read(is);
|
||||
return spec_ptr;
|
||||
@ -501,7 +501,7 @@ void EclipseGridParser::setFloatingPointField(const std::string& keyword,
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
void EclipseGridParser::setSpecialField(const std::string& keyword,
|
||||
boost::shared_ptr<SpecialBase> field)
|
||||
std::tr1::shared_ptr<SpecialBase> field)
|
||||
//---------------------------------------------------------------------------
|
||||
{
|
||||
special_field_map_[keyword] = field;
|
||||
|
@ -40,9 +40,9 @@ along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include "SpecialEclipseFields.hpp"
|
||||
#include "EclipseUnits.hpp"
|
||||
#include <tr1/memory>
|
||||
#include <dune/common/SpecialEclipseFields.hpp>
|
||||
#include <dune/common/EclipseUnits.hpp>
|
||||
#include <dune/common/Factory.hpp>
|
||||
|
||||
namespace Dune
|
||||
@ -53,7 +53,7 @@ namespace Dune
|
||||
|
||||
This object is constructed using an Eclipse .grdecl-file. All data
|
||||
fields are extracted upon construction and written to vector data
|
||||
structures, which can then be read out in O(1) time afterwards via
|
||||
structures, which can then be read out afterwards via
|
||||
convenience functions.
|
||||
|
||||
There is also a convenience function to easily check which fields
|
||||
@ -105,7 +105,7 @@ public:
|
||||
/// Returns a reference to a vector containing pointers to the values
|
||||
/// corresponding to the given keyword when the values are not only integers
|
||||
/// or floats.
|
||||
const boost::shared_ptr<SpecialBase> getSpecialValue(const std::string& keyword) const;
|
||||
const std::tr1::shared_ptr<SpecialBase> getSpecialValue(const std::string& keyword) const;
|
||||
|
||||
// This macro implements support for a special field keyword. It requires that a subclass
|
||||
// of SpecialBase exists, that has the same name as the keyword.
|
||||
@ -159,7 +159,7 @@ public:
|
||||
void setFloatingPointField(const std::string& keyword, const std::vector<double>& field);
|
||||
|
||||
/// Sets a special field to have a particular value.
|
||||
void setSpecialField(const std::string& keyword, boost::shared_ptr<SpecialBase> field);
|
||||
void setSpecialField(const std::string& keyword, std::tr1::shared_ptr<SpecialBase> field);
|
||||
|
||||
/// Compute the units used by the deck, depending on the presence
|
||||
/// of keywords such as METRIC, FIELD etc. It is an error to call
|
||||
@ -170,18 +170,18 @@ public:
|
||||
const EclipseUnits& units() const;
|
||||
|
||||
private:
|
||||
boost::shared_ptr<SpecialBase> createSpecialField(std::istream& is, const std::string& fieldname);
|
||||
std::tr1::shared_ptr<SpecialBase> createSpecialField(std::istream& is, const std::string& fieldname);
|
||||
void readImpl(std::istream& is);
|
||||
|
||||
|
||||
std::string directory_;
|
||||
std::map<std::string, std::vector<int> > integer_field_map_;
|
||||
std::map<std::string, std::vector<double> > floating_field_map_;
|
||||
std::map<std::string, boost::shared_ptr<SpecialBase> > special_field_map_;
|
||||
std::map<std::string, std::tr1::shared_ptr<SpecialBase> > special_field_map_;
|
||||
std::set<std::string> ignored_fields_;
|
||||
std::vector<int> empty_integer_field_;
|
||||
std::vector<double> empty_floating_field_;
|
||||
boost::shared_ptr<SpecialBase> empty_special_field_;
|
||||
std::tr1::shared_ptr<SpecialBase> empty_special_field_;
|
||||
EclipseUnits units_;
|
||||
};
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include <istream>
|
||||
#include <vector>
|
||||
#include <dune/common/ErrorMacros.hpp>
|
||||
#include "linInt.hpp"
|
||||
#include <dune/common/linInt.hpp>
|
||||
#include <boost/date_time/gregorian/gregorian.hpp>
|
||||
|
||||
namespace Dune
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
|
||||
#include <map>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <tr1/memory>
|
||||
|
||||
namespace Dune
|
||||
{
|
||||
@ -53,7 +53,7 @@ namespace Dune
|
||||
{
|
||||
public:
|
||||
/// The type of pointer returned by createObject().
|
||||
typedef boost::shared_ptr<Base> ProductPtr;
|
||||
typedef std::tr1::shared_ptr<Base> ProductPtr;
|
||||
|
||||
/// Creates a new object of the class associated with the given type string,
|
||||
/// and returns a pointer to it.
|
||||
@ -111,7 +111,7 @@ namespace Dune
|
||||
}
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<Creator> CreatorPtr;
|
||||
typedef std::tr1::shared_ptr<Creator> CreatorPtr;
|
||||
typedef std::map<std::string, CreatorPtr> CreatorMap;
|
||||
// This map contains the whole factory, i.e. all the Creators.
|
||||
CreatorMap string_to_creator_;
|
||||
@ -132,7 +132,7 @@ namespace Dune
|
||||
template <class Derived>
|
||||
void doAddCreator(const std::string& type)
|
||||
{
|
||||
boost::shared_ptr<Creator> c(new ConcreteCreator<Derived>);
|
||||
CreatorPtr c(new ConcreteCreator<Derived>);
|
||||
string_to_creator_[type] = c;
|
||||
}
|
||||
};
|
||||
|
@ -37,6 +37,8 @@
|
||||
#ifndef OPENRS_LININT_HEADER
|
||||
#define OPENRS_LININT_HEADER
|
||||
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
namespace Dune
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user