Ignore:
Timestamp:
Dec 22, 2016, 2:35:46 PM (2 years ago)
Author:
nmedfort
Message:

Modified memory alignment mechanism for GetPropertyValueGrepString? + misc. changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/PropertyObjects.h

    r5206 r5234  
    1414#include <vector>
    1515#include <unordered_map>
     16#include <boost/align/aligned_allocator.hpp>
    1617
    1718namespace UCD {
     19
     20using PropertyStringAllocator = boost::alignment::aligned_allocator<char, 32>;
     21
     22using PropertyString =
     23    std::basic_string<char, std::char_traits<char>, PropertyStringAllocator>;
    1824
    1925std::string canonicalize_value_name(const std::string & prop_or_val);
     
    3238        , UnsupportedProperty
    3339    };
     40
    3441    using iterator = const std::vector<std::string>::const_iterator;
    3542    inline ClassTypeId getClassTypeId() const {
     
    4148    PropertyObject(property_t p, ClassTypeId k) : the_property(p), the_kind(k) {}
    4249    virtual int GetPropertyValueEnumCode(const std::string & value_spec);
    43     virtual const std::string& GetPropertyValueGrepString();
     50    virtual const PropertyString & GetPropertyValueGrepString();
    4451    property_t the_property;
    4552    ClassTypeId the_kind;
     
    8996
    9097    virtual int GetPropertyValueEnumCode(const std::string & value_spec);
    91     virtual const std::string& GetPropertyValueGrepString();
     98    virtual const PropertyString & GetPropertyValueGrepString();
    9299    const UnicodeSet & GetCodepointSet(const std::string & value_spec);
    93100    const UnicodeSet & GetCodepointSet(const int property_enum_val) const;
     
    109116    const std::vector<std::string> & property_value_full_names;  // never changes
    110117    std::unordered_map<std::string, int> & property_value_aliases;
    111     std::string property_value_grep_string;
     118    PropertyString property_value_grep_string;
    112119    bool uninitialized; // full names must be added dynamically.
    113120    const std::vector<const UnicodeSet *> property_value_sets;
     
    139146
    140147    virtual int GetPropertyValueEnumCode(const std::string & value_spec);
    141     virtual const std::string& GetPropertyValueGrepString();
     148    virtual const PropertyString & GetPropertyValueGrepString();
    142149    const UnicodeSet & GetCodepointSet(const std::string & value_spec);
    143150    const UnicodeSet & GetCodepointSet(const int property_enum_val) const;
     
    165172    const UnicodeSet & GetCodepointSet(const std::string & value_spec);
    166173    const UnicodeSet & GetCodepointSet(const int property_enum_val);
    167     virtual const std::string& GetPropertyValueGrepString();
     174    virtual const PropertyString & GetPropertyValueGrepString();
    168175private:
    169176    bool mNoUninitialized;
    170177    UnicodeSet mY;
    171178    UnicodeSet mN;
    172     std::string property_value_grep_string;
     179    PropertyString property_value_grep_string;
    173180};
    174181
Note: See TracChangeset for help on using the changeset viewer.