Changeset 173

Show
Ignore:
Timestamp:
03/21/09 17:06:46 (15 years ago)
Author:
bhilburn
Message:

The cstring experiment failed. Heading back to std::strings.

Location:
vtcross/trunk/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/include/vtcross/components.h

    r171 r173  
    2020 
    2121#include <stdint.h> 
     22#include <string> 
    2223 
    2324#include "containers.h" 
     
    205206         */ 
    206207        void GetSolution(Observable *observables); 
    207         void GetSolution(Observable *observables, char* service); 
     208        void GetSolution(Observable *observables, std::string service); 
    208209 
    209210 
     
    217218                Parameter *parameters, Utility *utilities); 
    218219        void ReceiveFeedback(Observable *observables, \ 
    219                 Parameter *parameters, char* service); 
     220                Parameter *parameters, std::string service); 
    220221}; 
    221222 
  • vtcross/trunk/src/include/vtcross/containers.h

    r171 r173  
    1414 
    1515#include <stdint.h> 
     16#include <string> 
    1617 
    1718 
     
    3334 */ 
    3435struct Utility { 
    35     char* name; 
    36     char* units; 
    37     char* goal; 
     36    std::string name; 
     37    std::string units; 
     38    std::string goal; 
    3839    float target; 
    3940    float value; 
     
    4647struct Affect { 
    4748    Utility *u; 
    48     char* relation; 
     49    std::string relation; 
    4950}; 
    5051 
     
    5455 */ 
    5556struct Parameter { 
    56     char* name; 
    57     char* units; 
     57    std::string name; 
     58    std::string units; 
    5859    float min; 
    5960    uint32_t numAffects; 
     
    6970 */ 
    7071struct Observable { 
    71     char* name; 
     72    std::string name; 
    7273    Affect affection_list[10]; 
    7374    uint32_t numAffects; 
  • vtcross/trunk/src/lib/socketcomm/socketcomm.cpp

    r172 r173  
    114114        ReadMessage(socketFD, buffer); 
    115115        LOG("socket_comm::GetParameter - Name: %s\n", buffer); 
    116         pList[i].name = buffer; 
     116        pList[i].name = std::string(buffer); 
    117117     
    118118        memset(buffer, 0, 256); 
    119119        ReadMessage(socketFD, buffer); 
    120120        LOG("socket_comm::GetParameter - Units: %s\n", buffer); 
    121         pList[i].units = buffer; 
     121        pList[i].units = std::string(buffer); 
    122122 
    123123        memset(buffer, 0, 256);