View Single Post
  #5   Spotlight this post!  
Unread 04-12-2011, 01:03
theprgramerdude theprgramerdude is offline
WPI Freshman
AKA: Alex
FRC #2503 (Warrior Robotics)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Brainerd, Minnesota
Posts: 347
theprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud of
Re: Using a variable as a class object in Windriver/C++

It does, at the penalty of having a fixed number of spots with fixed names to map to unless additional code is written.

To be clear, I was referring to the data type map, not necessarily the c++ implementation. I can count at least 8 ways in C++ to implement the map with varying degrees of effectiveness, map and hash_map (assuming that library is included in Windriver by default) being the most flexible with mapping names.

Point being, the map structure could accept any valid integer and associate the corresponding solenoid with it; with an array, you are forced to associate a solenoid with a specific value from 0 to size - 1.
__________________
Attending: MN Duluth Regional