I'm creating an animation parameter system. An animation can have parameters of different types: float, int, etc. I'd like to store all of an object's parameters in a single vector or map and allow...
Type: Posts; User: pollypocket4eva
I'm creating an animation parameter system. An animation can have parameters of different types: float, int, etc. I'd like to store all of an object's parameters in a single vector or map and allow...
Any thoughts? Thanks.
Why? Because I want to be able to manage a group of objects that have similar properties but contain different types of data within one compact vector. Am I missing something?
I want to be able to store a vector of objects where each object is of the same base class (and can therefore be inserted into the vector), but where each object (of various derived classes) would...
Hey, thanks, but that code doesn't work for me.
I'm getting "virtual cannot be specified on member function templates."
Any ideas?
Hi,
I'm trying to do something like the following...
I would like fill a vector with objects that are of different type variations of the same template base class.
The code below of course does...
I'm trying to read a file that uses 0xd7 and 0x0d as delimiters and the following code keeps failing:
bool readFile(string FileName, vector<string>* FileOutput) {
string ...
Hey,
Thanks for your help.
It turned out there was some stray line of code somewhere that was causing the problem.
Got it now.
Hi,
Here is what I'm using to do my callbacks. I've determined that (for a reason unknown to me) that when test() is called through the callback, it gives the wrong value. Can anyone see why this...
I'm not using a dll. This is on os x.
// WITHOUT CALLBACK EVENT
$1 = {
static npos = 4294967295,
_M_dataplus = {
<std::allocator<char>> = {
<__gnu_cxx::new_allocator<char>>...
Oh, thanks.
Here is what print name gives back:
// WITHOUT CALLBACK EVENT
$1 = {
static npos = 4294967295,
_M_dataplus = {
Thanks again for your help.
I believe the problem has to do with the string I'm passing to find() in the method getItem().
Within my program, getItem() is often evoked during a callback event. It's...
Hey,
Sorry, here is a more complete backtrace:
#6 0x00012085 in GroupController::getInfo at GroupController.cpp:128
NOTE: here is what the calling method looks like...
void...
Hi,
Thanks for your help. Here is the modified code. Still produces the same problem.
// Group.h
#include "Item.h"
typedef map<string, Item*> GroupMap;
Hey,
Thanks.
Unfortunately, that isn't the problem. I also tried find(name) and got the same results.
What's wrong with this code? It seems to work fine most of the time, but I'm getting EXC_BAD_ACCESS on some occasions.
Here is the debug stack:
#4 0x00018016 in std::map<std::string,...
Hi,
I'm using the follow code in a socket connection function:
char input[100];
ssize_t n;
while((n = read(sockfd, input, sizeof input)) > 0) {
input[n] = '\0';
}
Hey,
Thanks for your help. I've just found my problem. Turns out the deque was actually fine all along. I thought I'd ruled out all other possible causes of the leak, but there was something I'd...
Well, MyType contains a lot of data, so I was reluctant to pass copies. I guess I can reconsider that a bit. I hadn't considered using shared_ptr as I don't feel I have a firm grasp on what that is....
Hi,
I can't figure out why the following is leaking memory - when I run the application the memory usage just keeps going up. Anyone see something wrong with this code:
I'm adding some initial...
So just to flesh it out (and don't worry, I'm not asking you to do my homework, I just want to understand the structure better and I'm not otherwise getting it:
I have:
struct aCoord {
int...
Thanks. I see your point that every case is covered. But I guess I'm having a hard time wrapping my mind around how the operator is applied by find() and so the ordering has me confused. Sorry and...
Ok, but how can the < operator address my struct? I need to test if first.a==second.a && first.b==second.b
The following does not do that:
bool operator<(const aCoord &other) const
{...
Anyone?
I've read that, but can't figure out how to apply it here.
Would it be something like this?
struct aCoord {
int a,b;
bool operator==(const aCoord &other) const
{ return (a ==...