Changeset 19220
- Timestamp:
- 03/24/15 12:04:33 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/datastructures/DataSet.cpp
r19215 r19220 92 92 int obj_enum; 93 93 int i; 94 94 95 95 if(marshall_direction==MARSHALLING_FORWARD || marshall_direction==MARSHALLING_SIZE){ 96 96 numsorted=objects.size(); … … 121 121 /*Recover enum of object first: */ 122 122 MARSHALLING_ENUM(obj_enum); 123 124 123 /*Reset the file pointer to point again to the beginning of the object: */ 125 124 *pmarshalled_data-=sizeof(int); … … 127 126 /*Giant case statement to spin-up the right object, and demarshall into it the information 128 127 *stored in the buffer: */ 129 switch(enum_type){ 130 case NodeEnum:{ 128 if(obj_enum==NodeEnum){ 131 129 Node* node=NULL; 132 130 node=new Node(); 133 131 node->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 134 this->AddObject(node);} 135 break; 136 case VertexEnum:{ 137 Vertex* vertex=NULL; 138 vertex=new Vertex(); 139 vertex->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 140 this->AddObject(vertex);} 141 break; 142 case DoubleParamEnum:{ 143 DoubleParam* doubleparam=NULL; 144 doubleparam=new DoubleParam(); 145 doubleparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 146 this->AddObject(doubleparam);} 147 break; 148 case IntParamEnum:{ 149 IntParam* intparam=NULL; 150 intparam=new IntParam(); 151 intparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 152 this->AddObject(intparam);} 153 break; 154 default: 155 _error_("could not recognize enum type: " << EnumToStringx(enum_type)); 132 this->AddObject(node); 156 133 } 134 else if(obj_enum==VertexEnum){ 135 Vertex* vertex=NULL; 136 vertex=new Vertex(); 137 vertex->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 138 this->AddObject(vertex); 139 break; 140 } 141 else if(obj_enum==DoubleParamEnum){ 142 DoubleParam* doubleparam=NULL; 143 doubleparam=new DoubleParam(); 144 doubleparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 145 this->AddObject(doubleparam); 146 break; 147 } 148 else if(obj_enum==IntParamEnum){ 149 IntParam* intparam=NULL; 150 intparam=new IntParam(); 151 intparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 152 this->AddObject(intparam); 153 break; 154 } 155 else _error_("could not recognize enum type: " << obj_enum); 157 156 } 158 157 }
Note:
See TracChangeset
for help on using the changeset viewer.