I'm coming from the Java world and are building a small c++ program at the moment.
I have an object that does some work and then returns the result of the work as a list.
Now a day later i changed the behavior of the object to save the results in a set to avoid duplicates in the container. But I can't simply return the set because I us...
Is there a .NET data structure I could use for bidirectional lookup?
Here's the problem: Serialization. My object contains a field which points to one of 10 predefined static objects. When writing to the file, I write a single character representing which of the 10 objects is being referenced. At this point, I need a lookup datastructur...
I'm looking for a container that maps from a double to object pointers. However, each key is simply a range of doubles that would correspond to that object.
For example, there could be a key/value pair that's <(0.0 3.0), ptr>, or <(3.5 10.0), ptr2>
container[1.0] should return ptr, container[3.0] should also return ptr, and container[-...
I have a VBox who dynamically adds and removes children programatically. The height is set to 100% and verticalScrollPolicy=auto.
When a user wants to add another child to that Vbox, I want it to autoscroll to the bottom of the VBox since that is where the child is added.
I've tried every solution I could find online, but no matter wha...
I have a collection of the form:
map<key, list<object> >
I only ever insert at the back of the list and sometimes I read from the entire map (but I never write to the map, except at initialization).
As I understand it, none of the STL containers are thread safe, but I can only really have a maximum of one thread per key. Am I miss...
Does anyone know of WPF code examples using Prism in which modules each register themselves as a menuitem in a menu within another module?
(I've currently got an application which tries to do this with the EventAggregator, so one module listens for published events from other modules which need to have their title in the menu as a menu ...
I have a map that relates integers to vectors (of objects). These vectors represent a set of tasks to perform. In order to reduce the amount of copying going on while using this map and vector I've set them up to make use of pointers.
std::map<int, std::vector<MyObject *> *> myMap;
During initialization of the class that holds myMap...
I've got a CustomersModule.cs with the following Initialize() method:
public void Initialize()
{
container.RegisterType<ICustomersRepository, CustomersRepository>(new ContainerControlledLifetimeManager());
CustomersPresenter customersPresenter = this.container.Resolve<CustomersPresenter>();
}
The class I resolve from the cont...
In this stackoverflow question I learned that Prism/Unity is not as decoupled as I thought, e.g. if I have this class which gets menuManager injected into its constructor, then I have to make sure that this class actually exists somewhere (I thought that you could just pull the .dll that contains the class and the container would deal wi...
I have a join function that operates on STL strings. I want to be able to apply it to to a container like this:
getFoos(const std::multimap<std::string, std::string>& map) {
return join_values(",", map.equal_range("foo"));
In other words, find all matching keys in the collection and concatenate the values into a single string wit...
I'd like to create two containers that contain iterators to each other. I'd like to do this hopefully without introducing any intermediate/indirect types. Is this possible or do iterator types depending on knowing the size of the container's data type?
Here is some sample code that I'd like to get compiling:
#include <map>
#include <de...
Hi all,
I'm writing a templated C++ generic container class that can optionally maintain its contents in a well-defined order. Previously it used function pointers to order its contents in a sensible type-specific way, but I am attempting to change it to use templated functor arguments instead.
Since it's often the case that the clas...
Hi,
I'm having a weird problem with adding stuff to my Container. Whenever I try to add the items it simply exits the while loop, even though isServer is still 1. I've tried to make a custom function, same result. Then i tried calling the Add(..) function directly and still same result. I don't see how inserting items to my container is...
i want hover over an image -> which is in an link
during i'm over the image should popup (like a tooltip) an div, which i can fill also with some stuff - any idea?!
$this is the link which includes an img:
i found the image within and wanted to span a div above the image and make some jquery effects which lets the user get the info, th...
Do you just base your STL container selections on the following attributes?
Searching/Updating
Insertion and
Deletion
If not, what else do you base your selections upon?
Is there any reference out there that lists how each container performs across all these different attributes?
...
I have just started learning Java Web Services ( JAX-WS ) and have one question. The reference documentation always talks about Web Services container. My question is : What is a Web Services container and why do we need it.
I saw a simple example of JAX-WS in book "java web services up and running" where the web service is published usi...
I notice the thread of similar question: http://stackoverflow.com/questions/1292/limit-size-of-queuet-in-net
That's exactly what I want to do, but I am not using .net but GNU C++. I have no reference to the base class in GNU C++, so java like super.() or .net like base.() will not work. I have been trying to inherite from queue class but...
I haven't seen any examples on the net. Was wondering if someone knows if there's one that exists or if it's even possible.
thanx
...
Could anyone please give me a brief full list of containers in Java? some of the ones I know are Array, Arraylist, Hashtable, HashMap, HatSet, Node, NodeList, TreeNode, TreeMap
...
I have a need for specialized collection classes. Let's call them FooItems and BarItems.
I basically need all the functionality of a List, but I need to do some extra work when new items are added or removed from the collection.
My first stab at this was to simply derive from List and List, then create my own Add and Remove methods....