finish work on populating initialization lists - closes #1114

This commit is contained in:
Dane Springmeyer 2012-04-16 21:57:24 -07:00
parent 77ac2992ab
commit 8fd0a40749
11 changed files with 73 additions and 42 deletions

View file

@ -68,7 +68,8 @@ public:
typedef typename map_type::const_iterator const_iterator;
context()
: base_type(mapping_) {}
: mapping_(),
base_type(mapping_) {}
size_type push(key_type const& name)
{

View file

@ -39,7 +39,8 @@ class layer_descriptor
public:
layer_descriptor(std::string const& name, std::string const& encoding)
: name_(name),
encoding_(encoding) {}
encoding_(encoding),
desc_ar_() {}
layer_descriptor(layer_descriptor const& other)
: name_(other.name_),

View file

@ -266,7 +266,8 @@ class MAPNIK_DECL face_manager : private boost::noncopyable
public:
face_manager(T & engine)
: engine_(engine),
stroker_(engine_.create_stroker()) {}
stroker_(engine_.create_stroker()),
face_ptr_cache_() {}
face_ptr get_face(std::string const& name)
{
@ -335,9 +336,9 @@ public:
}
private:
face_ptr_cache_type face_ptr_cache_;
font_engine_type & engine_;
stroker_ptr stroker_;
face_ptr_cache_type face_ptr_cache_;
};
template <typename T>

View file

@ -63,13 +63,13 @@ private:
unsigned width_;
unsigned height_;
std::string key_;
feature_key_type f_keys_;
feature_type features_;
data_type data_;
std::set<std::string> names_;
unsigned int resolution_;
std::string id_name_;
bool painted_;
std::set<std::string> names_;
feature_key_type f_keys_;
feature_type features_;
public:
@ -80,7 +80,10 @@ public:
data_(width,height),
resolution_(resolution),
id_name_("__id__"),
painted_(false)
painted_(false),
names_(),
f_keys_(),
features_()
{
// this only works if each datasource's
// feature count starts at 1
@ -94,7 +97,10 @@ public:
data_(rhs.data_),
resolution_(rhs.resolution_),
id_name_("__id__"),
painted_(rhs.painted_)
painted_(rhs.painted_),
names_(rhs.names_),
f_keys_(rhs.f_keys_),
features_(rhs.features_)
{
f_keys_[0] = "";
}

View file

@ -140,7 +140,7 @@ class label_collision_detector4 : boost::noncopyable
public:
struct label
{
label(box2d<double> const& b) : box(b) {}
label(box2d<double> const& b) : box(b), text() {}
label(box2d<double> const& b, UnicodeString const& t) : box(b), text(t) {}
box2d<double> box;

View file

@ -50,13 +50,18 @@ public:
typedef std::map<std::string, UnicodeString> property_map;
typedef property_map::const_iterator const_iterator;
metawriter_property_map() {}
metawriter_property_map() :
m_(),
not_found_() {}
UnicodeString const& operator[](std::string const& key) const;
UnicodeString& operator[](std::string const& key) {return m_[key];}
std::map<std::string, UnicodeString>::const_iterator find(std::string const& key) const
{
return m_.find(key);
}
std::map<std::string, UnicodeString>::const_iterator end() const
{
return m_.end();
@ -66,6 +71,7 @@ public:
{
return (*this)[key];
}
private:
property_map m_;
UnicodeString not_found_;

View file

@ -80,17 +80,22 @@ struct rgba
byte a;
inline rgba(byte r_, byte g_, byte b_, byte a_)
: r(r_), g(g_), b(b_), a(a_) {}
: r(r_),
g(g_),
b(b_),
a(a_) {}
inline rgba(rgb const& c)
: r(c.r), g(c.g), b(c.b), a(0xFF) {}
: r(c.r),
g(c.g),
b(c.b),
a(0xFF) {}
inline rgba(unsigned const& c) {
r = U2RED(c);
g = U2GREEN(c);
b = U2BLUE(c);
a = U2ALPHA(c);
}
inline rgba(unsigned const& c)
: r(U2RED(c)),
g(U2GREEN(c)),
b(U2BLUE(c)),
a(U2ALPHA(c)) {}
inline bool operator==(const rgba& y) const
{

View file

@ -86,23 +86,20 @@ class quad_tree : boost::noncopyable
typedef typename node::cont_t cont_t;
typedef typename cont_t::iterator node_data_iterator;
nodes_t nodes_;
node * root_;
const unsigned int max_depth_;
const double ratio_;
public:
typedef typename nodes_t::iterator iterator;
typedef typename nodes_t::const_iterator const_iterator;
typedef typename boost::ptr_vector<T,boost::view_clone_allocator> result_t;
typedef typename result_t::iterator query_iterator;
result_t query_result_;
explicit quad_tree(box2d<double> const& ext,
unsigned int max_depth = 8,
double ratio = 0.55)
: max_depth_(max_depth),
ratio_(ratio)
ratio_(ratio),
query_result_(),
nodes_()
{
nodes_.push_back(new node(ext));
root_ = &nodes_[0];
@ -219,6 +216,13 @@ private:
ext[2]=box2d<double>(lox,hiy - height*ratio_,lox + width * ratio_,hiy);
ext[3]=box2d<double>(hix - width * ratio_,hiy - height*ratio_,hix,hiy);
}
const unsigned int max_depth_;
const double ratio_;
result_t query_result_;
nodes_t nodes_;
node * root_;
};
}

View file

@ -40,14 +40,6 @@ class query
{
public:
typedef boost::tuple<double,double> resolution_type;
private:
box2d<double> bbox_;
resolution_type resolution_;
double scale_denominator_;
double filter_factor_;
box2d<double> unbuffered_bbox_;
std::set<std::string> names_;
public:
query(box2d<double> const& bbox,
resolution_type const& resolution,
@ -57,7 +49,8 @@ public:
resolution_(resolution),
scale_denominator_(scale_denominator),
filter_factor_(1.0),
unbuffered_bbox_(unbuffered_bbox)
unbuffered_bbox_(unbuffered_bbox),
names_()
{}
query(box2d<double> const& bbox,
@ -67,7 +60,8 @@ public:
resolution_(resolution),
scale_denominator_(scale_denominator),
filter_factor_(1.0),
unbuffered_bbox_(bbox)
unbuffered_bbox_(bbox),
names_()
{}
query(box2d<double> const& bbox)
@ -75,7 +69,8 @@ public:
resolution_(resolution_type(1.0,1.0)),
scale_denominator_(1.0),
filter_factor_(1.0),
unbuffered_bbox_(bbox)
unbuffered_bbox_(bbox),
names_()
{}
query(query const& other)
@ -94,8 +89,8 @@ public:
resolution_=other.resolution_;
scale_denominator_=other.scale_denominator_;
filter_factor_=other.filter_factor_;
names_=other.names_;
unbuffered_bbox_=other.unbuffered_bbox_;
names_=other.names_;
return *this;
}
@ -119,12 +114,12 @@ public:
return unbuffered_bbox_;
}
void set_unbuffered_bbox(const box2d<double>& bbox)
void set_unbuffered_bbox(box2d<double> const& bbox)
{
unbuffered_bbox_ = bbox;
}
void set_bbox(const box2d<double>& bbox)
void set_bbox(box2d<double> const& bbox)
{
bbox_ = bbox;
}
@ -148,6 +143,14 @@ public:
{
return names_;
}
private:
box2d<double> bbox_;
resolution_type resolution_;
double scale_denominator_;
double filter_factor_;
box2d<double> unbuffered_bbox_;
std::set<std::string> names_;
};
}

View file

@ -46,7 +46,9 @@ namespace mapnik { namespace util {
typedef vertex_vector<T> container_type;
vertex_iterator()
: v_(SEG_END,0,0)
: v_(SEG_END,0,0),
vertices_(),
pos_(0)
{}
explicit vertex_iterator(container_type const& vertices)
@ -74,8 +76,8 @@ namespace mapnik { namespace util {
return v_;
}
container_type const *vertices_;
value_type v_;
container_type const *vertices_;
unsigned pos_;
};

View file

@ -31,12 +31,14 @@ namespace mapnik {
class value_error : public std::exception
{
public:
value_error() {}
value_error() :
what_() {}
value_error( std::string const& what ) :
what_( what )
{
}
virtual ~value_error() throw() {};
virtual const char * what() const throw()