Questions tagged [boost-flyweight]

8 questions
7
votes
3 answers

Flyweights with Boost and external data sources

Maybe there is a simple way around this that I'm not seeing, so hopefully somebody can explain it to me. Let's say I have a class: class A { public: const double parameter; const std::string name; const std:: string fileName; A(const…
tpg2114
  • 14,112
  • 6
  • 42
  • 57
3
votes
1 answer

Boost flyweight for short strings

I am implementing a system that stores and manipulates a lot of repetitive short strings. For example stock price series. I will have a lot of repetitive entries of Microsoft stock prices: ,MSFT,60.01 ,MSFT,60.02 ,MSFT,60.00 I…
CuriousMind
  • 15,168
  • 20
  • 82
  • 120
3
votes
1 answer

boost flyweight panics

I am using Boost 1.39. I've implemented my class using boost::flyweight > (my application is single-threaded). Test program for my class passes fine, but when I use in in the application, I panic in #9 0x08de7c3e in…
dbbd
  • 864
  • 1
  • 8
  • 23
3
votes
2 answers

Is there a way to get information on a boost::flyweight internal container?

Using boost::flyweight is supposed to help me save memory. I am looking for way to get a quantitative measurement on the effectiveness of the solution. Is there a way to get the size() of the internal container? If its a hash based flyweight, is…
dbbd
  • 864
  • 1
  • 8
  • 23
3
votes
1 answer

Does boost::flyweight do reference counting?

I've been reading the documentation of boost::flyweight but i don't see any mention to deallocation or reference counting policies. Basically a flyweight object should behave like a repository of distinct values, but its not clear what happens when…
lurscher
  • 25,930
  • 29
  • 122
  • 185
1
vote
1 answer

How to use boost::flyweight as a GOF pattern?

I can't understand how to use boost::flyweight as a GOF pattern. Is there are exist example somewhere? For example, I expect it usage in the following way. There must be some flyweight container, that consist the "fat" objects. This container can…
AeroSun
  • 2,401
  • 2
  • 23
  • 46
1
vote
1 answer

boost::flyweight doesn't work for class

first i used flyweight for string which works fine, but when i use flyweight for a struct. it doesn't work. the first test case for string is: static void testflyweightString() { char tmp[0]; vector> boost_v; for(int…
ideasky
  • 11
  • 2
1
vote
1 answer

Using Boost flyweight with shared memory

I'd like to keep a large number of (frequently duplicated) strings in shared-memory, so I'm using Boost's flyweight and interprocess basic_string functionality. To ensure that the string is actually stored in the shared-memory, I need to supply a…
bovine
  • 5,303
  • 2
  • 18
  • 17