/home/coin/SVN-release/OS-2.4.0/OS/src/OSCommonInterfaces/OSrLWriter.cpp

Go to the documentation of this file.
00001 /* $Id: OSrLWriter.cpp 4292 2011-09-21 05:47:18Z kmartin $ */
00016 //#define DEBUG
00017 
00018 #include "OSrLWriter.h"
00019 #include "OSResult.h"
00020 #include "OSgLWriter.h"
00021 #include "OSGeneral.h"
00022 #include "OSStringUtil.h"
00023 #include "OSParameters.h"
00024 #include "OSConfig.h"
00025 #include "OSBase64.h"
00026 #include "OSMathUtil.h"
00027 #include <sstream>
00028 #include <iostream>
00029 #include <stdio.h>
00030 
00031 using std::cout;
00032 using std::endl;
00033 using std::ostringstream;
00034 
00035 OSrLWriter::OSrLWriter( )
00036 {
00037     m_bWriteBase64 = false;
00038     m_bWhiteSpace = false;
00039 }
00040 
00041 OSrLWriter::~OSrLWriter()
00042 {
00043 }
00044 
00045 
00046 /*char* OSrLWriter::writeOSrLWrap( OSResult *theosresult){
00047         std::string sTmp = writeOSrL( theosresult);
00048         char *ch;
00049     ch = new char[sTmp.size() + 1];
00050     strcpy(ch, sTmp.c_str());
00051         return ch;
00052 }
00053 */
00054 
00055 
00056 std::string OSrLWriter::writeOSrL( OSResult *theosresult)
00057 {
00058     m_OSResult = theosresult;
00059     std::ostringstream outStr;
00060 #ifdef WIN_
00061     const char  dirsep='\\';
00062 #else
00063     const char  dirsep='/';
00064 #endif
00065     // Set directory containing stylesheet files.
00066     std::string xsltDir;
00067     xsltDir = dirsep == '/' ? "../stylesheets/" : "..\\stylesheets\\";
00068     // always go with '/' -- it is a hypertext reference
00069     // xsltDir = "../stylesheets/";
00070     xsltDir = "http://www.coin-or.org/OS/stylesheets/";
00071 
00072     int i, j;
00073     bool generalTagPrinted;
00074     bool systemTagPrinted;
00075     bool serviceTagPrinted;
00076     bool jobTagPrinted;
00077 #ifdef DEBUG
00078     cout << "in OSrLWriter" << endl;
00079 #endif
00080 
00081     if(m_OSResult == NULL)  return outStr.str();
00082     outStr << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" ;
00083     outStr << "<?xml-stylesheet type=\"text/xsl\" href=\"";
00084     outStr << xsltDir;
00085     outStr << "OSrL.xslt\"?>";
00086     outStr << endl;
00087     outStr << "<osrl xmlns=\"os.optimizationservices.org\"   xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
00088     outStr << "xsi:schemaLocation=\"os.optimizationservices.org http://www.optimizationservices.org/schemas/";
00089     outStr << OS_SCHEMA_VERSION;
00090     outStr << "/OSrL.xsd\" >" ;
00091     outStr << endl;
00092 
00093 #ifdef DEBUG
00094     cout << "output <resultHeader>" << endl;
00095 #endif
00096     if(m_OSResult->resultHeader != NULL)
00097     {
00098         if (m_OSResult->resultHeader->name        != "" ||
00099                 m_OSResult->resultHeader->source      != "" ||
00100                 m_OSResult->resultHeader->description != "" ||
00101                 m_OSResult->resultHeader->fileCreator != "" ||
00102                 m_OSResult->resultHeader->licence     != "" )
00103         {
00104             outStr << "<resultHeader>" << endl;
00105             outStr << writeGeneralFileHeader(m_OSResult->resultHeader, true);
00106             outStr << "</resultHeader>" << endl;
00107         }
00108     }
00109 
00110 
00111 #ifdef DEBUG
00112     cout << "output <general>" << endl;
00113 #endif
00114     if(m_OSResult->general != NULL)
00115     {
00116         generalTagPrinted = false;
00117         if(m_OSResult->general->generalStatus != NULL)
00118         {
00119             if (generalTagPrinted == false)
00120             {
00121                 outStr << "<general>" << endl;
00122                 generalTagPrinted = true;
00123             }
00124             outStr << "<generalStatus";
00125             if(m_OSResult->general->generalStatus->type.length() > 0)
00126             {
00127                 outStr << " type=\"";
00128                 outStr << m_OSResult->general->generalStatus->type ;
00129                 outStr << "\"";
00130             }
00131             if(m_OSResult->general->generalStatus->description.length() > 0)
00132             {
00133                 outStr << " description=";
00134                 outStr << writeStringData(m_OSResult->general->generalStatus->description);
00135             }
00136             if (m_OSResult->general->generalStatus->numberOfSubstatuses > 0)
00137             {
00138                 outStr << " numberOfSubstatuses=\"";
00139                 outStr << m_OSResult->general->generalStatus->numberOfSubstatuses;
00140                 outStr << "\"";
00141             }
00142             outStr << ">" << endl;
00143             for (int i=0; i < m_OSResult->general->generalStatus->numberOfSubstatuses; i++)
00144             {
00145                 outStr << "<substatus";
00146                 if (m_OSResult->general->generalStatus->substatus[i]->name.length() > 0)
00147                 {
00148                     outStr << " name=\"";
00149                     outStr << m_OSResult->general->generalStatus->substatus[i]->name ;
00150                     outStr << "\"";
00151                 }
00152                 if (m_OSResult->general->generalStatus->substatus[i]->description.length() > 0)
00153                 {
00154                     outStr << " description=\"";
00155                     outStr << m_OSResult->general->generalStatus->substatus[i]->description ;
00156                     outStr << "\"";
00157                 }
00158                 outStr << "/>" << endl;
00159             }
00160             outStr << "</generalStatus>" << endl;
00161         }
00162 
00163         if(m_OSResult->general->message.length() > 0)
00164         {
00165             if (generalTagPrinted == false)
00166             {
00167                 outStr << "<general>" << endl;
00168                 generalTagPrinted = true;
00169             }
00170             outStr << "<message>" + m_OSResult->general->message  + "</message>" << endl;
00171         }
00172         if(m_OSResult->general->serviceURI.length() > 0)
00173         {
00174             if (generalTagPrinted == false)
00175             {
00176                 outStr << "<general>" << endl;
00177                 generalTagPrinted = true;
00178             }
00179             outStr << "<serviceURI>" + m_OSResult->general->serviceURI + "</serviceURI>"  << endl;
00180         }
00181         if(m_OSResult->general->serviceName.length() > 0)
00182         {
00183             if (generalTagPrinted == false)
00184             {
00185                 outStr << "<general>" << endl;
00186                 generalTagPrinted = true;
00187             }
00188             outStr << "<serviceName>" + m_OSResult->general->serviceName + "</serviceName>"  << endl;
00189         }
00190         if(m_OSResult->general->instanceName.length() > 0)
00191         {
00192             if (generalTagPrinted == false)
00193             {
00194                 outStr << "<general>" << endl;
00195                 generalTagPrinted = true;
00196             }
00197             outStr << "<instanceName>" + m_OSResult->general->instanceName  + "</instanceName>" << endl;
00198         }
00199         if(m_OSResult->general->jobID.length() > 0)
00200         {
00201             if (generalTagPrinted == false)
00202             {
00203                 outStr << "<general>" << endl;
00204                 generalTagPrinted = true;
00205             }
00206             outStr << "<jobID>" + m_OSResult->general->jobID  + "</jobID>" << endl;
00207         }
00208         if(m_OSResult->general->solverInvoked.length() > 0)
00209         {
00210             if (generalTagPrinted == false)
00211             {
00212                 outStr << "<general>" << endl;
00213                 generalTagPrinted = true;
00214             }
00215             outStr << "<solverInvoked>" + m_OSResult->general->solverInvoked  + "</solverInvoked>" << endl;
00216         }
00217         if(m_OSResult->general->timeStamp.length() > 0)
00218         {
00219             if (generalTagPrinted == false)
00220             {
00221                 outStr << "<general>" << endl;
00222                 generalTagPrinted = true;
00223             }
00224             outStr << "<timeStamp>" + m_OSResult->general->timeStamp  + "</timeStamp>" << endl;
00225         }
00226 
00227         if(m_OSResult->general->otherResults != NULL)
00228         {
00229             if(m_OSResult->general->otherResults->numberOfOtherResults > 0)
00230             {
00231                 if (generalTagPrinted == false)
00232                 {
00233                     outStr << "<general>" << endl;
00234                     generalTagPrinted = true;
00235                 }
00236                 outStr << "<otherResults numberOfOtherResults=\"";
00237                 outStr << m_OSResult->general->otherResults->numberOfOtherResults;
00238                 outStr << "\">" << endl;
00239                 for (int i=0; i < m_OSResult->general->otherResults->numberOfOtherResults; i++)
00240                 {
00241                     outStr << "<other";
00242                     if (m_OSResult->general->otherResults->other[i]->name.length() > 0)
00243                     {
00244                         outStr << " name=";
00245                         outStr << writeStringData(m_OSResult->general->otherResults->other[i]->name);
00246                     }
00247                     if (m_OSResult->general->otherResults->other[i]->value.length() > 0)
00248                     {
00249                         outStr << " value=";
00250                         outStr << writeStringData(m_OSResult->general->otherResults->other[i]->value);
00251                     }
00252                     if (m_OSResult->general->otherResults->other[i]->description.length() > 0)
00253                     {
00254                         outStr << " description=";
00255                         outStr << writeStringData(m_OSResult->general->otherResults->other[i]->description);
00256                     }
00257                     outStr << " />" << endl;
00258                 }
00259                 outStr << "</otherResults>" << endl;;
00260             }
00261         }
00262         if (generalTagPrinted == true)
00263             outStr << "</general>" << endl;
00264     }
00265 
00266 
00267 #ifdef DEBUG
00268     cout << "output <system>" << endl;
00269 #endif
00270     if(m_OSResult->system != NULL)
00271     {
00272         systemTagPrinted = false;
00273         if(m_OSResult->system->systemInformation.length() > 0)
00274         {
00275             if (systemTagPrinted == false)
00276             {
00277                 outStr << "<system>" << endl;
00278                 systemTagPrinted = true;
00279             }
00280             outStr << "<systemInformation>" + m_OSResult->system->systemInformation  + "</systemInformation>" << endl;
00281         }
00282 
00283         if(m_OSResult->system->availableDiskSpace != NULL)
00284         {
00285             if (systemTagPrinted == false)
00286             {
00287                 outStr << "<system>" << endl;
00288                 systemTagPrinted = true;
00289             }
00290             outStr << "<availableDiskSpace";
00291             if(m_OSResult->system->availableDiskSpace->unit.length() > 0)
00292             {
00293                 outStr << " unit=\"";
00294                 outStr << m_OSResult->system->availableDiskSpace->unit;
00295                 outStr << "\"";
00296             }
00297             if(m_OSResult->system->availableDiskSpace->description.length() > 0)
00298             {
00299                 outStr << " description=";
00300                 outStr << writeStringData(m_OSResult->system->availableDiskSpace->description);
00301             }
00302             outStr << ">";
00303             outStr << os_dtoa_format(m_OSResult->system->availableDiskSpace->value);
00304             outStr << "</availableDiskSpace>" << endl;
00305         }
00306 
00307         if(m_OSResult->system->availableMemory != NULL)
00308         {
00309             if (systemTagPrinted == false)
00310             {
00311                 outStr << "<system>" << endl;
00312                 systemTagPrinted = true;
00313             }
00314             outStr << "<availableMemory";
00315             if(m_OSResult->system->availableMemory->unit.length() > 0)
00316             {
00317                 outStr << " unit=\"";
00318                 outStr << m_OSResult->system->availableMemory->unit;
00319                 outStr << "\"";
00320             }
00321             if(m_OSResult->system->availableMemory->description.length() > 0)
00322             {
00323                 outStr << " description=";
00324                 outStr << writeStringData(m_OSResult->system->availableMemory->description);
00325             }
00326             outStr << ">";
00327             outStr << os_dtoa_format(m_OSResult->system->availableMemory->value);
00328             outStr << "</availableMemory>" << endl;
00329         }
00330 
00331         if(m_OSResult->system->availableCPUSpeed != NULL)
00332         {
00333             if (systemTagPrinted == false)
00334             {
00335                 outStr << "<system>" << endl;
00336                 systemTagPrinted = true;
00337             }
00338             outStr << "<availableCPUSpeed";
00339             if(m_OSResult->system->availableCPUSpeed->unit.length() > 0)
00340             {
00341                 outStr << " unit=\"";
00342                 outStr << m_OSResult->system->availableCPUSpeed->unit ;
00343                 outStr << "\"";
00344             }
00345             if(m_OSResult->system->availableCPUSpeed->description.length() > 0)
00346             {
00347                 outStr << " description=";
00348                 outStr << writeStringData(m_OSResult->system->availableCPUSpeed->description);
00349             }
00350             outStr << ">";
00351             outStr << os_dtoa_format(m_OSResult->system->availableCPUSpeed->value);
00352             outStr << "</availableCPUSpeed>" << endl;
00353         }
00354 
00355         if(m_OSResult->system->availableCPUNumber != NULL)
00356         {
00357             if (systemTagPrinted == false)
00358             {
00359                 outStr << "<system>" << endl;
00360                 systemTagPrinted = true;
00361             }
00362             outStr << "<availableCPUNumber";
00363             if(m_OSResult->system->availableCPUNumber->description.length() > 0)
00364             {
00365                 outStr << " description=";
00366                 outStr << writeStringData(m_OSResult->system->availableCPUNumber->description);
00367             }
00368             outStr << ">";
00369             outStr << m_OSResult->system->availableCPUNumber->value;
00370             outStr << "</availableCPUNumber>" << endl;
00371         }
00372 
00373         if(m_OSResult->system->otherResults != NULL)
00374         {
00375             if(m_OSResult->system->otherResults->numberOfOtherResults > 0)
00376             {
00377                 if (systemTagPrinted == false)
00378                 {
00379                     outStr << "<system>" << endl;
00380                     systemTagPrinted = true;
00381                 }
00382                 outStr << "<otherResults numberOfOtherResults=\"";
00383                 outStr << m_OSResult->system->otherResults->numberOfOtherResults;
00384                 outStr << "\">" << endl;
00385                 for (int i=0; i < m_OSResult->system->otherResults->numberOfOtherResults; i++)
00386                 {
00387                     outStr << "<other";
00388                     if (m_OSResult->system->otherResults->other[i]->name.length() > 0)
00389                     {
00390                         outStr << " name=";
00391                         outStr << writeStringData(m_OSResult->system->otherResults->other[i]->name);
00392                     }
00393                     if (m_OSResult->system->otherResults->other[i]->value.length() > 0)
00394                     {
00395                         outStr << " value=";
00396                         outStr << writeStringData(m_OSResult->system->otherResults->other[i]->value);
00397                     }
00398                     if (m_OSResult->system->otherResults->other[i]->description.length() > 0)
00399                     {
00400                         outStr << " description=";
00401                         outStr << writeStringData(m_OSResult->system->otherResults->other[i]->description);
00402                     }
00403                     outStr << " />" << endl;
00404                 }
00405                 outStr << "</otherResults>" << endl;
00406             }
00407         }
00408         if (systemTagPrinted == true)
00409             outStr << "</system>" << endl;
00410     }
00411 
00412 
00413 #ifdef DEBUG
00414     cout << "output <service>" << endl;
00415 #endif
00416     if(m_OSResult->service != NULL)
00417     {
00418         serviceTagPrinted = false;
00419         if(m_OSResult->service->currentState.length() > 0 && m_OSResult->service->currentState != "unknown")
00420         {
00421             if (serviceTagPrinted == false)
00422             {
00423                 outStr << "<service>" << endl;
00424                 serviceTagPrinted = true;
00425             }
00426             outStr << "<currentState>" << m_OSResult->service->currentState << "</currentState>" << endl;
00427         }
00428         if(m_OSResult->service->currentJobCount >= 0)
00429         {
00430             if (serviceTagPrinted == false)
00431             {
00432                 outStr << "<service>" << endl;
00433                 serviceTagPrinted = true;
00434             }
00435             outStr << "<currentJobCount>" << m_OSResult->service->currentJobCount << "</currentJobCount>" << endl;
00436         }
00437         if(m_OSResult->service->totalJobsSoFar >= 0)
00438         {
00439             if (serviceTagPrinted == false)
00440             {
00441                 outStr << "<service>" << endl;
00442                 serviceTagPrinted = true;
00443             }
00444             outStr << "<totalJobsSoFar>" << m_OSResult->service->totalJobsSoFar << "</totalJobsSoFar>" << endl;
00445         }
00446         if(m_OSResult->service->timeServiceStarted.length() > 0 && m_OSResult->service->timeServiceStarted != "1970-01-01T00:00:00-00:00")
00447         {
00448             if (serviceTagPrinted == false)
00449             {
00450                 outStr << "<service>" << endl;
00451                 serviceTagPrinted = true;
00452             }
00453             outStr << "<timeServiceStarted>" << m_OSResult->service->timeServiceStarted << "</timeServiceStarted>" << endl;
00454         }
00455         if(m_OSResult->service->serviceUtilization != -1.0)
00456         {
00457             if (serviceTagPrinted == false)
00458             {
00459                 outStr << "<service>" << endl;
00460                 serviceTagPrinted = true;
00461             }
00462             outStr << "<serviceUtilization>" << os_dtoa_format(m_OSResult->service->serviceUtilization) << "</serviceUtilization>" << endl;
00463         }
00464 
00465         if(m_OSResult->service->otherResults != NULL)
00466         {
00467             if(m_OSResult->service->otherResults->numberOfOtherResults > 0)
00468             {
00469                 if (serviceTagPrinted == false)
00470                 {
00471                     outStr << "<service>" << endl;
00472                     serviceTagPrinted = true;
00473                 }
00474                 outStr << "<otherResults numberOfOtherResults=\"";
00475                 outStr << m_OSResult->service->otherResults->numberOfOtherResults;
00476                 outStr << "\">" << endl;
00477                 for (int i=0; i < m_OSResult->service->otherResults->numberOfOtherResults; i++)
00478                 {
00479                     outStr << "<other";
00480                     if (m_OSResult->service->otherResults->other[i]->name.length() > 0)
00481                     {
00482                         outStr << " name=";
00483                         outStr << writeStringData(m_OSResult->service->otherResults->other[i]->name);
00484                     }
00485                     if (m_OSResult->service->otherResults->other[i]->value.length() > 0)
00486                     {
00487                         outStr << " value=";
00488                         outStr << writeStringData(m_OSResult->service->otherResults->other[i]->value);
00489                     }
00490                     if (m_OSResult->service->otherResults->other[i]->description.length() > 0)
00491                     {
00492                         outStr << " description=";
00493                         outStr << writeStringData(m_OSResult->service->otherResults->other[i]->description);
00494                     }
00495                     outStr << " />" << endl;
00496                 }
00497                 outStr << "</otherResults>" << endl;
00498             }
00499         }
00500         if (serviceTagPrinted == true)
00501             outStr << "</service>" << endl;
00502     }
00503 
00504 
00505 #ifdef DEBUG
00506     cout << "output <job>" << endl;
00507 #endif
00508     if(m_OSResult->job != NULL)
00509     {
00510         jobTagPrinted = false;
00511 
00512         if(m_OSResult->job->status.length() > 0 && m_OSResult->job->status != "finished")
00513         {
00514             if (jobTagPrinted == false)
00515             {
00516                 outStr << "<job>" << endl;
00517                 jobTagPrinted = true;
00518             }
00519             outStr << "<status>" + m_OSResult->job->status  + "</status>" << endl;
00520         }
00521         if(m_OSResult->job->submitTime.length() > 0 && m_OSResult->job->submitTime != "1970-01-01T00:00:00-00:00")
00522         {
00523             if (jobTagPrinted == false)
00524             {
00525                 outStr << "<job>" << endl;
00526                 jobTagPrinted = true;
00527             }
00528             outStr << "<submitTime>" + m_OSResult->job->submitTime  + "</submitTime>" << endl;
00529         }
00530         if(m_OSResult->job->scheduledStartTime.length() > 0 && m_OSResult->job->scheduledStartTime != "1970-01-01T00:00:00-00:00")
00531         {
00532             if (jobTagPrinted == false)
00533             {
00534                 outStr << "<job>" << endl;
00535                 jobTagPrinted = true;
00536             }
00537             outStr << "<scheduledStartTime>" + m_OSResult->job->scheduledStartTime  + "</scheduledStartTime>" << endl;
00538         }
00539         if(m_OSResult->job->actualStartTime.length() > 0 && m_OSResult->job->actualStartTime != "1970-01-01T00:00:00-00:00")
00540         {
00541             if (jobTagPrinted == false)
00542             {
00543                 outStr << "<job>" << endl;
00544                 jobTagPrinted = true;
00545             }
00546             outStr << "<actualStartTime>" + m_OSResult->job->actualStartTime  + "</actualStartTime>" << endl;
00547         }
00548         if(m_OSResult->job->endTime.length() > 0 && m_OSResult->job->endTime != "1970-01-01T00:00:00-00:00")
00549         {
00550             if (jobTagPrinted == false)
00551             {
00552                 outStr << "<job>" << endl;
00553                 jobTagPrinted = true;
00554             }
00555             outStr << "<endTime>" + m_OSResult->job->endTime  + "</endTime>" << endl;
00556         }
00557 
00558         if (m_OSResult->job->timingInformation != NULL)
00559         {
00560             if (jobTagPrinted == false)
00561             {
00562                 outStr << "<job>" << endl;
00563                 jobTagPrinted = true;
00564             }
00565             outStr << "<timingInformation numberOfTimes=\"";
00566             outStr << m_OSResult->job->timingInformation->numberOfTimes << "\">" << endl;
00567             for (i=0; i<m_OSResult->job->timingInformation->numberOfTimes; i++)
00568             {
00569                 outStr << "<time";
00570                 if (m_OSResult->job->timingInformation->time[i]->type != "")
00571                     outStr << " type=\"" << m_OSResult->job->timingInformation->time[i]->type << "\"";
00572                 if (m_OSResult->job->timingInformation->time[i]->unit != "")
00573                     outStr << " unit=\"" << m_OSResult->job->timingInformation->time[i]->unit << "\"";
00574                 if (m_OSResult->job->timingInformation->time[i]->category != "")
00575                     outStr << " category=\"" << m_OSResult->job->timingInformation->time[i]->category << "\"";
00576                 if (m_OSResult->job->timingInformation->time[i]->description != "")
00577                     outStr << " description=" << writeStringData(m_OSResult->job->timingInformation->time[i]->description);
00578                 outStr << ">" << endl;
00579                 outStr << os_dtoa_format(m_OSResult->job->timingInformation->time[i]->value);
00580                 outStr << "</time>" << endl;
00581             }
00582             outStr << "</timingInformation>" << endl;
00583         }
00584 
00585         if(m_OSResult->job->usedDiskSpace != NULL)
00586         {
00587             if (jobTagPrinted == false)
00588             {
00589                 outStr << "<job>" << endl;
00590                 jobTagPrinted = true;
00591             }
00592             outStr << "<usedDiskSpace";
00593             if(m_OSResult->job->usedDiskSpace->unit.length() > 0)
00594             {
00595                 outStr << " unit=\"";
00596                 outStr << m_OSResult->job->usedDiskSpace->unit ;
00597                 outStr << "\"";
00598             }
00599             if(m_OSResult->job->usedDiskSpace->description.length() > 0)
00600             {
00601                 outStr << " description=";
00602                 outStr << writeStringData(m_OSResult->job->usedDiskSpace->description);
00603             }
00604             outStr << ">";
00605             outStr << os_dtoa_format(m_OSResult->job->usedDiskSpace->value);
00606             outStr << "</usedDiskSpace>" << endl;
00607         }
00608 
00609         if(m_OSResult->job->usedMemory != NULL)
00610         {
00611             if (jobTagPrinted == false)
00612             {
00613                 outStr << "<job>" << endl;
00614                 jobTagPrinted = true;
00615             }
00616             outStr << "<usedMemory";
00617             if(m_OSResult->job->usedMemory->unit.length() > 0)
00618             {
00619                 outStr << " unit=\"";
00620                 outStr << m_OSResult->job->usedMemory->unit ;
00621                 outStr << "\"";
00622             }
00623             if(m_OSResult->job->usedMemory->description.length() > 0)
00624             {
00625                 outStr << " description=";
00626                 outStr << writeStringData(m_OSResult->job->usedMemory->description);
00627             }
00628             outStr << ">";
00629             outStr << os_dtoa_format(m_OSResult->job->usedMemory->value);
00630             outStr << "</usedMemory>" << endl;
00631         }
00632 
00633         if(m_OSResult->job->usedCPUSpeed != NULL)
00634         {
00635             if (jobTagPrinted == false)
00636             {
00637                 outStr << "<job>" << endl;
00638                 jobTagPrinted = true;
00639             }
00640             outStr << "<usedCPUSpeed";
00641             if(m_OSResult->job->usedCPUSpeed->unit.length() > 0)
00642             {
00643                 outStr << " unit=\"";
00644                 outStr << m_OSResult->job->usedCPUSpeed->unit ;
00645                 outStr << "\"";
00646             }
00647             if(m_OSResult->job->usedCPUSpeed->description.length() > 0)
00648             {
00649                 outStr << " description=";
00650                 outStr << writeStringData(m_OSResult->job->usedCPUSpeed->description);
00651             }
00652             outStr << ">";
00653             outStr << os_dtoa_format(m_OSResult->job->usedCPUSpeed->value);
00654             outStr << "</usedCPUSpeed>" << endl;
00655         }
00656 
00657         if(m_OSResult->job->usedCPUNumber != NULL)
00658         {
00659             if (jobTagPrinted == false)
00660             {
00661                 outStr << "<job>" << endl;
00662                 jobTagPrinted = true;
00663             }
00664             outStr << "<usedCPUNumber";
00665             if(m_OSResult->job->usedCPUNumber->description.length() > 0)
00666             {
00667                 outStr << " description=";
00668                 outStr << writeStringData(m_OSResult->job->usedCPUNumber->description);
00669             }
00670             outStr << ">";
00671             outStr << m_OSResult->job->usedCPUNumber->value;
00672             outStr << "</usedCPUNumber>" << endl;
00673         }
00674 
00675         if(m_OSResult->job->otherResults != NULL)
00676         {
00677             if(m_OSResult->job->otherResults->numberOfOtherResults > 0)
00678             {
00679                 if (jobTagPrinted == false)
00680                 {
00681                     outStr << "<job>" << endl;
00682                     jobTagPrinted = true;
00683                 }
00684                 outStr << "<otherResults numberOfOtherResults=\"";
00685                 outStr << m_OSResult->job->otherResults->numberOfOtherResults;
00686                 outStr << "\">" << endl;
00687                 for (int i=0; i < m_OSResult->job->otherResults->numberOfOtherResults; i++)
00688                 {
00689                     outStr << "<other";
00690                     if (m_OSResult->job->otherResults->other[i]->name.length() > 0)
00691                     {
00692                         outStr << " name=";
00693                         outStr << writeStringData(m_OSResult->job->otherResults->other[i]->name);
00694                     }
00695                     if (m_OSResult->job->otherResults->other[i]->value.length() > 0)
00696                     {
00697                         outStr << " value=";
00698                         outStr << writeStringData(m_OSResult->job->otherResults->other[i]->value);
00699                     }
00700                     if (m_OSResult->job->otherResults->other[i]->description.length() > 0)
00701                     {
00702                         outStr << " description=";
00703                         outStr << writeStringData(m_OSResult->job->otherResults->other[i]->description);
00704                     }
00705                     outStr << " />" << endl;
00706                 }
00707                 outStr << "</otherResults>"  << endl;
00708             }
00709         }
00710         if (jobTagPrinted == true)
00711             outStr << "</job>" << endl;
00712     }
00713 
00714 
00715 #ifdef DEBUG
00716     cout << "output <optimization>" << endl;
00717 #endif
00718     if(m_OSResult->optimization != NULL)
00719     {
00720         outStr << "<optimization " ;
00721         outStr << "numberOfSolutions=\"";
00722         outStr << m_OSResult->optimization->numberOfSolutions ;
00723         outStr <<  "\"";
00724         if (m_OSResult->optimization->numberOfVariables >= 0)
00725         {
00726             outStr << " numberOfVariables=\"";
00727             outStr << m_OSResult->optimization->numberOfVariables ;
00728             outStr <<  "\"";
00729         }
00730         if (m_OSResult->optimization->numberOfConstraints >= 0)
00731         {
00732             outStr << " numberOfConstraints=\"";
00733             outStr << m_OSResult->optimization->numberOfConstraints ;
00734             outStr <<  "\"";
00735         }
00736         if (m_OSResult->optimization->numberOfObjectives >= 0)
00737         {
00738             outStr << " numberOfObjectives=\"";
00739             outStr << m_OSResult->optimization->numberOfObjectives ;
00740             outStr << "\"" ;
00741         }
00742         outStr << ">" << endl;
00743         // get solution information
00744         for(i = 0; i < m_OSResult->optimization->numberOfSolutions; i++)
00745         {
00746             if(m_OSResult->optimization->solution[i] != NULL)
00747             {
00748                 outStr << "<solution" ;
00749                 outStr << " targetObjectiveIdx=\"";
00750                 outStr << m_OSResult->optimization->solution[i]->targetObjectiveIdx ;
00751                 outStr << "\"" ;
00752                 if (m_OSResult->optimization->solution[i]->targetObjectiveName.length() > 0)
00753                 {
00754                     outStr << " targetObjectiveName=";
00755                     outStr <<  writeStringData(m_OSResult->optimization->solution[i]->targetObjectiveName);
00756                 }
00757                 if (m_OSResult->optimization->solution[i]->weightedObjectives)
00758                     outStr << " weightedObjectives=\"true\"";
00759                 outStr << ">" << endl;
00760                 if(m_OSResult->optimization->solution[i]->status != NULL)
00761                 {
00762                     outStr << "<status";
00763                     if (m_OSResult->optimization->solution[i]->status->numberOfSubstatuses > 0)
00764                     {
00765                         outStr << " numberOfSubstatuses=\"";
00766                         outStr << m_OSResult->optimization->solution[i]->status->numberOfSubstatuses ;
00767                         outStr <<  "\"";
00768                     }
00769                     if(m_OSResult->optimization->solution[i]->status->type.length() > 0)
00770                     {
00771                         outStr << " type=\"";
00772                         outStr << m_OSResult->optimization->solution[i]->status->type;
00773                         outStr <<  "\"";
00774                     }
00775                     if(m_OSResult->optimization->solution[i]->status->description.length() > 0)
00776                     {
00777                         outStr << " description=";
00778                         outStr <<  writeStringData(m_OSResult->optimization->solution[i]->status->description);
00779                     }
00780                     outStr << ">" << endl;
00781                     for (int j=0; j < m_OSResult->optimization->solution[i]->status->numberOfSubstatuses; j++)
00782                     {
00783                         outStr << "<substatus";
00784                         if(m_OSResult->optimization->solution[i]->status->substatus[j]->type.length() > 0)
00785                         {
00786                             outStr << " type=\"";
00787                             outStr << m_OSResult->optimization->solution[i]->status->substatus[j]->type;
00788                             outStr <<  "\"";
00789                         }
00790                         if(m_OSResult->optimization->solution[i]->status->substatus[j]->description.length() > 0)
00791                         {
00792                             outStr << " description=";
00793                             outStr <<  writeStringData(m_OSResult->optimization->solution[i]->status->substatus[j]->description);
00794                         }
00795                         outStr << "/>" << endl;
00796                     }
00797                     outStr << "</status>" << endl;
00798                 }
00799 
00800                 if(m_OSResult->optimization->solution[i]->message != "")
00801                 {
00802                     outStr << "<message>";
00803                     outStr << m_OSResult->optimization->solution[i]->message;
00804                     outStr << "</message>" << endl;
00805                 }
00806                 if(m_OSResult->optimization->solution[i]->variables != NULL)
00807                 {
00808                     outStr << "<variables ";
00809                     if (m_OSResult->optimization->solution[i]->variables->numberOfOtherVariableResults > 0)
00810                         outStr << "numberOfOtherVariableResults=\"" << m_OSResult->optimization->solution[i]->variables->numberOfOtherVariableResults << "\"";
00811                     outStr << ">" << endl;
00812                     if(m_OSResult->optimization->solution[i]->variables->values != NULL)
00813                     {
00814 #ifdef DEBUG
00815                         cout << "output <variables> <values>" << endl;
00816 #endif
00817                         outStr << "<values numberOfVar=\"" << m_OSResult->optimization->solution[i]->variables->values->numberOfVar << "\">" << endl;
00818                         for(j = 0; j < m_OSResult->optimization->solution[i]->variables->values->numberOfVar; j++)
00819                         {
00820                             if(m_OSResult->optimization->solution[i]->variables->values->var[j] != NULL)
00821                             {
00822                                 outStr << "<var";
00823                                 outStr << " idx=\"";
00824                                 outStr << m_OSResult->optimization->solution[i]->variables->values->var[j]->idx;
00825                                 outStr <<  "\"";
00826                                 if (m_OSResult->optimization->solution[i]->variables->values->var[j]->name != "")
00827                                     outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->variables->values->var[j]->name);
00828                                 outStr <<  ">";
00829                                 outStr <<  os_dtoa_format( m_OSResult->optimization->solution[i]->variables->values->var[j]->value );
00830                                 outStr << "</var>" << endl;
00831                             }
00832                         }
00833                         outStr << "</values>" << endl;
00834                     }
00835 
00836                     if(m_OSResult->optimization->solution[i]->variables->valuesString != NULL)
00837                     {
00838 #ifdef DEBUG
00839                         cout << "output <variables> <valuesString>" << endl;
00840 #endif
00841                         outStr << "<valuesString numberOfVar=\"" << m_OSResult->optimization->solution[i]->variables->valuesString->numberOfVar << "\">" << endl;
00842                         for(j = 0; j < m_OSResult->optimization->solution[i]->variables->valuesString->numberOfVar; j++)
00843                         {
00844                             if(m_OSResult->optimization->solution[i]->variables->valuesString->var[j] != NULL)
00845                             {
00846                                 outStr << "<var";
00847                                 outStr << " idx=\"";
00848                                 outStr << m_OSResult->optimization->solution[i]->variables->valuesString->var[j]->idx;
00849                                 outStr <<  "\"";
00850                                 if (m_OSResult->optimization->solution[i]->variables->valuesString->var[j]->name != "")
00851                                     outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->variables->valuesString->var[j]->name);
00852                                 outStr <<  ">";
00853                                 outStr <<  m_OSResult->optimization->solution[i]->variables->valuesString->var[j]->value;
00854                                 outStr << "</var>" << endl;
00855                             }
00856                         }
00857                         outStr << "</valuesString>" << endl;
00858                     }
00859 
00860                     if(m_OSResult->optimization->solution[i]->variables->basisStatus != NULL)
00861                     {
00862 #ifdef DEBUG
00863                         cout << "output <variables> <basisStatus>" << endl;
00864 #endif
00865                         outStr << "<basisStatus>" << endl;
00866                         outStr << writeBasisStatus(m_OSResult->optimization->solution[i]->variables->basisStatus, m_bWhiteSpace, m_bWriteBase64);
00867                         outStr << "</basisStatus>" << endl;
00868                     }
00869 
00870 #ifdef DEBUG
00871                     cout << "output <variables> <other>" << endl;
00872 #endif
00873                     if(m_OSResult->optimization->solution[i]->variables->other != NULL)
00874                     {
00875                         if(m_OSResult->optimization->solution[i]->variables->numberOfOtherVariableResults > 0)
00876                         {
00877                             for(int k = 0; k < m_OSResult->optimization->solution[i]->variables->numberOfOtherVariableResults; k++)
00878                             {
00879                                 outStr << "<other";
00880                                 if (m_OSResult->optimization->solution[i]->variables->other[k]->numberOfVar > 0)
00881                                 {
00882                                     outStr << " numberOfVar=\"";
00883                                     outStr << m_OSResult->optimization->solution[i]->variables->other[k]->numberOfVar;
00884                                     outStr << "\"" ;
00885                                 }
00886                                 else if(m_OSResult->optimization->solution[i]->variables->other[k]->numberOfEnumerations > 0)
00887                                 {
00888                                     outStr << " numberOfEnumerations=\"";
00889                                     outStr << m_OSResult->optimization->solution[i]->variables->other[k]->numberOfEnumerations;
00890                                     outStr << "\"" ;
00891                                 }
00892                                 outStr << " name=";
00893                                 outStr << writeStringData(m_OSResult->optimization->solution[i]->variables->other[k]->name);
00894                                 if (m_OSResult->optimization->solution[i]->variables->other[k]->value != "")
00895                                 {
00896                                     outStr << " value=\"";
00897                                     outStr << m_OSResult->optimization->solution[i]->variables->other[k]->value;
00898                                     outStr << "\"" ;
00899                                 }
00900                                 if (m_OSResult->optimization->solution[i]->variables->other[k]->description != "")
00901                                 {
00902                                     outStr << " description=";
00903                                     outStr << writeStringData(m_OSResult->optimization->solution[i]->variables->other[k]->description);
00904                                 }
00905                                 outStr << ">" << endl;
00906                                 if(m_OSResult->optimization->solution[i]->variables->other[k]->numberOfVar > 0)
00907                                 {
00908                                     for(j = 0; j < m_OSResult->optimization->solution[i]->variables->other[k]->numberOfVar; j++)
00909                                     {
00910                                         outStr << "<var";
00911                                         outStr << " idx=\"";
00912                                         outStr << m_OSResult->optimization->solution[i]->variables->other[k]->var[j]->idx ;
00913                                         outStr <<  "\"";
00914                                         if (m_OSResult->optimization->solution[i]->variables->other[k]->var[j]->name != "")
00915                                             outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->variables->other[k]->var[j]->name);
00916                                         outStr <<  ">";
00917                                         outStr << m_OSResult->optimization->solution[i]->variables->other[k]->var[j]->value;
00918                                         outStr << "</var>" << endl;
00919                                     }
00920                                 }
00921                                 else if (m_OSResult->optimization->solution[i]->variables->other[k]->numberOfEnumerations > 0)
00922                                 {
00923                                     for(j = 0; j < m_OSResult->optimization->solution[i]->variables->other[k]->numberOfEnumerations; j++)
00924                                     {
00925                                         outStr << writeOtherOptionEnumeration(m_OSResult->optimization->solution[i]->variables->other[k]->enumeration[j],
00926                                                                               m_bWhiteSpace, m_bWriteBase64);
00927                                     }
00928                                 }
00929                                 outStr << "</other>" << endl;
00930                             }
00931                         }
00932                     } // end of if on other variables
00933                     outStr << "</variables>" << endl;
00934                 }
00935                 if(m_OSResult->optimization->solution[i]->objectives != NULL)
00936                 {
00937                     outStr << "<objectives ";
00938                     if (m_OSResult->optimization->solution[i]->objectives->numberOfOtherObjectiveResults > 0)
00939                         outStr << "numberOfOtherObjectiveResults=\"" << m_OSResult->optimization->solution[i]->objectives->numberOfOtherObjectiveResults << "\"";
00940                     outStr << ">" << endl;
00941 #ifdef DEBUG
00942                     cout << "output <objectives> <values>" << endl;
00943 #endif
00944                     if(m_OSResult->optimization->solution[i]->objectives->values != NULL)
00945                     {
00946                         outStr << "<values numberOfObj=\"" << m_OSResult->optimization->solution[i]->objectives->values->numberOfObj << "\">" << endl;
00947                         for(j = 0; j < m_OSResult->optimization->solution[i]->objectives->values->numberOfObj; j++)
00948                         {
00949                             if(m_OSResult->optimization->solution[i]->objectives->values->obj[j] != NULL)
00950                             {
00951                                 outStr << "<obj";
00952                                 outStr << " idx=\"";
00953                                 outStr << m_OSResult->optimization->solution[i]->objectives->values->obj[j]->idx; //-(1 + j) ;
00954                                 outStr <<  "\"";
00955                                 if (m_OSResult->optimization->solution[i]->objectives->values->obj[j]->name != "")
00956                                     outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->objectives->values->obj[j]->name);
00957                                 outStr <<  ">";
00958                                 outStr <<  os_dtoa_format( m_OSResult->optimization->solution[i]->objectives->values->obj[j]->value);
00959                                 outStr << "</obj>" << endl;
00960                             }
00961                         }
00962 
00963                         outStr << "</values>" << endl;
00964                     }
00965 
00966                     if(m_OSResult->optimization->solution[i]->objectives->basisStatus != NULL)
00967                     {
00968 #ifdef DEBUG
00969                         cout << "output <objectives> <basisStatus>" << endl;
00970 #endif
00971                         outStr << "<basisStatus>" << endl;
00972                         outStr << writeBasisStatus(m_OSResult->optimization->solution[i]->objectives->basisStatus, m_bWhiteSpace, m_bWriteBase64);
00973                         outStr << "</basisStatus>" << endl;
00974                     }
00975 
00976 #ifdef DEBUG
00977                     cout << "output <objectives> <other>" << endl;
00978 #endif
00979                     if(m_OSResult->optimization->solution[i]->objectives->other != NULL)
00980                     {
00981                         if(m_OSResult->optimization->solution[i]->objectives->numberOfOtherObjectiveResults > 0)
00982                         {
00983                             for(int k = 0; k < m_OSResult->optimization->solution[i]->objectives->numberOfOtherObjectiveResults; k++)
00984                             {
00985                                 outStr << "<other" ;
00986                                 if (m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfObj > 0)
00987                                 {
00988                                     outStr << " numberOfObj=\"";
00989                                     outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfObj;
00990                                     outStr << "\"" ;
00991                                 }
00992                                 else if(m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfEnumerations > 0)
00993                                 {
00994                                     outStr << " numberOfEnumerations=\"";
00995                                     outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfEnumerations;
00996                                     outStr << "\"" ;
00997                                 }
00998                                 if (m_OSResult->optimization->solution[i]->objectives->other[k]->name != "")
00999                                 {
01000                                     outStr << " name=";
01001                                     \
01002                                     outStr << writeStringData(m_OSResult->optimization->solution[i]->objectives->other[k]->name);
01003                                 };
01004                                 if (m_OSResult->optimization->solution[i]->objectives->other[k]->value != "")
01005                                 {
01006                                     outStr << " value=\"";
01007                                     \
01008                                     outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->value;
01009                                     outStr << "\"" ;
01010                                 };
01011                                 if (m_OSResult->optimization->solution[i]->objectives->other[k]->description != "")
01012                                 {
01013                                     outStr << " description=";
01014                                     outStr << writeStringData(m_OSResult->optimization->solution[i]->objectives->other[k]->description);
01015                                 };
01016                                 outStr <<  ">" << endl;
01017                                 if(m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfObj > 0)
01018                                 {
01019                                     for(j = 0; j < m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfObj; j++)
01020                                     {
01021                                         outStr << "<obj";
01022                                         outStr << " idx=\"";
01023                                         outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->obj[j]->idx;
01024                                         outStr <<  "\"";
01025                                         if (m_OSResult->optimization->solution[i]->objectives->other[k]->obj[j]->name != "")
01026                                             outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->objectives->other[k]->obj[j]->name);
01027                                         outStr <<  ">";
01028                                         outStr <<   m_OSResult->optimization->solution[i]->objectives->other[k]->obj[j]->value;
01029                                         outStr << "</obj>" << endl;
01030                                     }
01031                                 }
01032                                 else if (m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfEnumerations > 0)
01033                                 {
01034                                     for(j = 0; j < m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfEnumerations; j++)
01035                                     {
01036                                         outStr << writeOtherOptionEnumeration(m_OSResult->optimization->solution[i]->objectives->other[k]->enumeration[j],
01037                                                                               m_bWhiteSpace, m_bWriteBase64);
01038                                     }
01039                                 }
01040                                 outStr << "</other>" << endl;
01041                             }
01042                         }
01043                     } // end of if on other objectives
01044                     outStr << "</objectives>" << endl;
01045                 }
01046                 if(m_OSResult->optimization->solution[i]->constraints != NULL)
01047                 {
01048                     outStr << "<constraints ";
01049                     if (m_OSResult->optimization->solution[i]->constraints->numberOfOtherConstraintResults > 0)
01050                         outStr << "numberOfOtherConstraintResults=\"" << m_OSResult->optimization->solution[i]->constraints->numberOfOtherConstraintResults << "\"";
01051                     outStr << ">" << endl;
01052 #ifdef DEBUG
01053                     cout << "output <constraints> <dualValues>" << endl;
01054 #endif
01055                     if(m_OSResult->optimization->solution[i]->constraints->dualValues != NULL)
01056                     {
01057                         outStr << "<dualValues numberOfCon=\"" << m_OSResult->optimization->solution[i]->constraints->dualValues->numberOfCon << "\">" << endl;
01058                         for(j = 0; j < m_OSResult->optimization->solution[i]->constraints->dualValues->numberOfCon; j++)
01059                         {
01060                             if(m_OSResult->optimization->solution[i]->constraints->dualValues->con[j] != NULL)
01061                             {
01062                                 outStr << "<con";
01063                                 outStr << " idx=\"";
01064                                 outStr <<  m_OSResult->optimization->solution[i]->constraints->dualValues->con[j]->idx;
01065                                 outStr <<  "\"";
01066                                 if (m_OSResult->optimization->solution[i]->constraints->dualValues->con[j]->name != "")
01067                                     outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->constraints->dualValues->con[j]->name);
01068                                 outStr <<  ">";
01069                                 outStr <<  os_dtoa_format( m_OSResult->optimization->solution[i]->constraints->dualValues->con[j]->value);
01070                                 outStr << "</con>" << endl;
01071                             }
01072                         }
01073                         outStr << "</dualValues>" << endl;
01074                     }
01075 
01076                     if(m_OSResult->optimization->solution[i]->constraints->basisStatus != NULL)
01077                     {
01078 #ifdef DEBUG
01079                         cout << "output <constraints> <basisStatus>" << endl;
01080 #endif
01081                         outStr << "<basisStatus>" << endl;
01082                         outStr << writeBasisStatus(m_OSResult->optimization->solution[i]->constraints->basisStatus, m_bWhiteSpace, m_bWriteBase64);
01083                         outStr << "</basisStatus>" << endl;
01084                     }
01085 
01086 #ifdef DEBUG
01087                     cout << "output <constraints> <other>" << endl;
01088 #endif
01089                     if(m_OSResult->optimization->solution[i]->constraints->other != NULL)
01090                     {
01091                         if(m_OSResult->optimization->solution[i]->constraints->numberOfOtherConstraintResults > 0)
01092                         {
01093                             for(int k = 0; k < m_OSResult->optimization->solution[i]->constraints->numberOfOtherConstraintResults; k++)
01094                             {
01095                                 outStr << "<other" ;
01096                                 if (m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfCon > 0)
01097                                 {
01098                                     outStr << " numberOfCon=\"";
01099                                     outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfCon;
01100                                     outStr << "\"";
01101                                 }
01102                                 else if(m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfEnumerations > 0)
01103                                 {
01104                                     outStr << " numberOfEnumerations=\"";
01105                                     outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfEnumerations;
01106                                     outStr << "\"" ;
01107                                 }
01108                                 outStr << " name=";
01109                                 \
01110                                 outStr << writeStringData(m_OSResult->optimization->solution[i]->constraints->other[k]->name);
01111                                 if (m_OSResult->optimization->solution[i]->constraints->other[k]->value != "")
01112                                 {
01113                                     outStr << " value=\"";
01114                                     \
01115                                     outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->value;
01116                                     outStr << "\"" ;
01117                                 };
01118                                 if (m_OSResult->optimization->solution[i]->constraints->other[k]->description != "")
01119                                 {
01120                                     outStr << " description=";
01121                                     outStr << writeStringData(m_OSResult->optimization->solution[i]->constraints->other[k]->description);
01122                                 };
01123                                 outStr <<  ">" << endl;
01124                                 if(m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfCon > 0)
01125                                 {
01126                                     for(j = 0; j < m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfCon; j++)
01127                                     {
01128                                         outStr << "<con";
01129                                         outStr << " idx=\"";
01130                                         outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->con[j]->idx;
01131                                         outStr <<  "\"";
01132                                         if (m_OSResult->optimization->solution[i]->constraints->other[k]->con[j]->name != "")
01133                                             outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->constraints->other[k]->con[j]->name);
01134                                         outStr <<  ">";
01135                                         outStr <<  m_OSResult->optimization->solution[i]->constraints->other[k]->con[j]->value;
01136                                         outStr << "</con>" << endl;
01137                                     }
01138                                 }
01139                                 else if (m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfEnumerations > 0)
01140                                 {
01141                                     for(j = 0; j < m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfEnumerations; j++)
01142                                     {
01143                                         outStr << writeOtherOptionEnumeration(m_OSResult->optimization->solution[i]->constraints->other[k]->enumeration[j],
01144                                                                               m_bWhiteSpace, m_bWriteBase64);
01145                                     }
01146                                 }
01147                                 outStr << "</other>" << endl;
01148                             }
01149                         }
01150                     } // end of if on other constraints
01151                     outStr << "</constraints>" << endl;
01152                 }
01153 
01154 
01155 #ifdef DEBUG
01156                 cout << "output <otherSolutionResults>" << endl;
01157 #endif
01158                 if (m_OSResult->optimization->solution[i]->otherSolutionResults != NULL)
01159                 {
01160                     outStr << "<otherSolutionResults numberOfOtherSolutionResults=\"";
01161                     outStr << m_OSResult->optimization->solution[i]->otherSolutionResults->numberOfOtherSolutionResults;
01162                     outStr << "\">" << std::endl;
01163                     for(int k = 0; k < m_OSResult->optimization->solution[i]->otherSolutionResults->numberOfOtherSolutionResults; k++)
01164                     {
01165                         outStr << "<otherSolutionResult";
01166                         outStr << " name=";
01167                         outStr << writeStringData(m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->name);
01168                         outStr << " numberOfItems=\"";
01169                         outStr << m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->numberOfItems;
01170                         outStr << "\"";
01171                         if (m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->category != "")
01172                             outStr << " category=\"" << m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->category << "\"";
01173                         if (m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->description != "")
01174                             outStr << " description=" << writeStringData(m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->description);
01175                         outStr << ">" << std::endl;
01176                         for(int j = 0; j < m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->numberOfItems; j++)
01177                             outStr << "<item>" << m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->item[j] << "</item>" << std::endl;
01178                         outStr << "</otherSolutionResult>" << std::endl;
01179                     }
01180                     outStr << "</otherSolutionResults>" << std::endl;
01181                 }
01182                 outStr << "</solution>" << endl;
01183             } // end if solution not NULL
01184         } // end for loop(i=0..numberOfSolutions)
01185 
01186 
01187 #ifdef DEBUG
01188         cout << "output <otherSolverOutput>" << endl;
01189 #endif
01190         if (m_OSResult->optimization->otherSolverOutput != NULL)
01191 //                      if (m_OSResult->optimization->otherSolverOutput->numberOfSolverOutputs > 0)
01192         {
01193             outStr << "<otherSolverOutput numberOfSolverOutputs=\"";
01194             outStr << m_OSResult->optimization->otherSolverOutput->numberOfSolverOutputs;
01195             outStr << "\">" << std::endl;
01196             for(int k = 0; k < m_OSResult->optimization->otherSolverOutput->numberOfSolverOutputs; k++)
01197             {
01198                 outStr << "<solverOutput";
01199                 outStr << " name=\"";
01200                 outStr << m_OSResult->optimization->otherSolverOutput->solverOutput[k]->name;
01201                 outStr << "\"";
01202                 outStr << " numberOfItems=\"";
01203                 outStr << m_OSResult->optimization->otherSolverOutput->solverOutput[k]->numberOfItems;
01204                 outStr << "\"";
01205                 if (m_OSResult->optimization->otherSolverOutput->solverOutput[k]->category != "")
01206                     outStr << " category=\"" << m_OSResult->optimization->otherSolverOutput->solverOutput[k]->category << "\"";
01207                 if (m_OSResult->optimization->otherSolverOutput->solverOutput[k]->description != "")
01208                     outStr << " description=" << writeStringData(m_OSResult->optimization->otherSolverOutput->solverOutput[k]->description);
01209                 outStr << ">" << std::endl;
01210                 for(int j = 0; j < m_OSResult->optimization->otherSolverOutput->solverOutput[k]->numberOfItems; j++)
01211                 {
01212                     outStr << "<item>" << m_OSResult->optimization->otherSolverOutput->solverOutput[k]->item[j] << "</item>" << std::endl;
01213                 }
01214                 outStr << "</solverOutput>" << std::endl;
01215             }
01216             outStr << "</otherSolverOutput>" << std::endl;
01217         }
01218 
01219         outStr << "</optimization>" << endl;
01220     } // end if (optimization != NULL)
01221     outStr << "</osrl>" << endl ;
01222 #ifdef DEBUG
01223     cout << "done" << endl;
01224 #endif
01225     return outStr.str();
01226 }// end writeOSrL
01227 
01228 

Generated on Thu Sep 22 03:06:03 2011 by  doxygen 1.4.7