Changeset 206

Show
Ignore:
Timestamp:
03/24/09 18:28:31 (15 years ago)
Author:
bhilburn
Message:

Wrote out basic structure for the WaitForSignal? for the SML. Note that
I still think integer opcodes are the way to go.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/service_management_layer/ServiceManagementLayer.cpp

    r204 r206  
    6666ServiceManagementLayer::WaitForSignal() 
    6767{ 
     68    char buffer[256]; 
     69 
     70    while(true) { 
     71        memset(buffer, 0, 256); 
     72        
     73        ReadMessage(shellSocketFD, buffer); 
     74 
     75        // TODO 
     76        // If we send integer op codes rather than strings, this process will be 
     77        // MUCH faster since instead of donig string compares we can simply 
     78        // switch on the integer value... 
     79        if(strcmp(buffer, "register_service") == 0) { 
     80            if(strcmp(buffer, "policy_geo") == 0) { 
     81            } 
     82            else if(strcmp(buffer, "policy_time") == 0) { 
     83            } 
     84            else if(strcmp(buffer, "policy_spectrum") == 0) { 
     85            } 
     86            else if(strcmp(buffer, "policy_spacial") == 0) { 
     87            } 
     88        } 
     89        else if(strcmp(buffer, "deregister_service") == 0) { 
     90            if(strcmp(buffer, "policy_geo") == 0) { 
     91            } 
     92            else if(strcmp(buffer, "policy_time") == 0) { 
     93            } 
     94            else if(strcmp(buffer, "policy_spectrum") == 0) { 
     95            } 
     96            else if(strcmp(buffer, "policy_spacial") == 0) { 
     97            } 
     98        } 
     99        else if(strcmp(buffer, "query_component_type") == 0) { 
     100            SendComponentType(); 
     101        } 
     102        else if(strcmp(buffer, "reset_sml") == 0) { 
     103            Reset(); 
     104        } 
     105        else if(strcmp(buffer, "shutdown_sml") == 0) { 
     106            Shutdown(); 
     107        } 
     108    } 
    68109} 
    69110