Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NamedValMap in object makes it non-VectorOf-able?
#1
In one of my objects (called A), I have a type of VectorOf of another custom made object (B). That has worked just fine. But I needed to add a namedValMap to B. However, upon doing so, and doing ONLY that, I get the compiler error:

MEng.User....B is not a copyable class, but a copyable class is required here

and the error line is where I create the Types:

VectorOf[B] ListOfB;

All I do is add the Import path, and create a namedValMap object in Members...no other changes. If I remove those 2 lines, it compiles fine.

I'm probably missing why this is such a bad thing.
Reply
#2
It may just be a mistake that the named value map isn't copyable. I'd have to look at it. But, assuming there was some reason, you can't have copyable classes made up of uncopyable ones, since you couldn't copy those parts.

Generally non-copyable classes are things like files or directories or stuff like that, which don't hold data but refer to other things. But a named value map effectively just holds data, so in theory you'd think it should be copyable.
Dean Roddey
Explorans limites defectum
Reply
#3
Can you check and let me know, and an ETA? I really don't want to have to write my own code to mimic what the map would do for me, but if it's going to be an unknown amount of weeks, or isn't fixable, then I'll get started on it.
Reply
#4
beelzerob Wrote:Can you check and let me know, and an ETA? I really don't want to have to write my own code to mimic what the map would do for me, but if it's going to be an unknown amount of weeks, or isn't fixable, then I'll get started on it.
OK, it looks like it was really just an oversight, so I've changed it to be copyable. I'll test it out here in a bit once I get the code rebuilt as 2.4.19. So it should be copyable in the next drop.
Dean Roddey
Explorans limites defectum
Reply
#5
thanks! Thanks!
Reply
#6
Dean, it compiles now...but when I go to add an object B (which has the map in it) into my vector of object B's, I get this error:

'MEng.System.Runtime.NamedValMap' and 'MEng.System.Runtime.NamedValMap' are not compatible types

Attached is the full error message.


Attached Files
.zip   error.zip (Size: 14.71 KB / Downloads: 0)
Reply
#7
Oops, I'll look into that for tomorrow. Sorry. I hadn't actually meant for it to be available yet, because I'd not really tested it. But the event server thing today forced me to make a release and I forgot about that in the rush.
Dean Roddey
Explorans limites defectum
Reply
#8
No worries. I was happy to have it so quickly.
Reply
#9
Hmmm... I'm having trouble reproducing this. It's working ok for me. I created a A class that has a Card1 and a named value map. I created a B class that defines a vector of those and creates a memeber of that type, and provides an Add method to add A objects to it. Then I created a top level class that defines a vector of B objects. I add a B object to the vector, then reference that 0'th object and call its Add method to add an A object to that.

That all works fine for me. Can you come up with a simple example that demonstrates this problem?
Dean Roddey
Explorans limites defectum
Reply
#10
Hmm...maybe I was doing some kind of illegal code calling or something. I'll post the code when I get home.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Available Makes and Models gReatAutomation 7 2,067 07-15-2019, 04:19 PM
Last Post: Dean Roddey
  Upgrade to 5.0.1: Local config object store Jnetto 2 2,810 11-20-2016, 06:12 PM
Last Post: Dean Roddey
  How do I get numeric month from Time object? Sendero 2 1,729 04-25-2010, 05:07 PM
Last Post: Sendero
  NamedValMap request froop 14 3,448 12-11-2008, 02:25 PM
Last Post: sic0048
  CML Driver Question - calling CQCDriverBase Methods from a nested object bph 11 4,947 11-25-2008, 08:27 AM
Last Post: bph
  Error assigning image to wiget - Creation of the bitmap object failed jrlewis 7 2,215 10-06-2008, 05:55 AM
Last Post: jrlewis
  "Command 'LoadMacro' is not implemented by object IVB 4 1,746 07-05-2008, 02:42 PM
Last Post: IVB
  NamedValMap Iteration wuench 6 2,320 08-22-2007, 02:19 PM
Last Post: wuench
  "Object {blah} was not found. Pass go but don't collect your drivers." Bodshal 3 1,854 02-26-2007, 05:50 PM
Last Post: Bodshal
  NamedValMap - Name restrictions Hitchcocknz 16 4,944 12-04-2006, 11:23 PM
Last Post: Hitchcocknz

Forum Jump:


Users browsing this thread: 1 Guest(s)