Wide Studio Object Reference

Wide Studio Home
Up to

## Class Name

WSCconductor

## Specification of methods

### WSGIconductor Function Description

Form
  WSCconductor* WSGIconductor()
Function
  Obtain a global instance of store control class existing for each application
Description
Parameters
  None.
Return value
  A pointer to a store controls class instance
Notice
  This function is a global function, not a member function. Also, do not release the returned pointer.
Samples

      #include <WSCconductor.h>
      void sample_proc(){
        WSCbase* window   = NULL; //Store the returned value(Loaded application window)
        char*    stype    = "FILE";           //FILE Specify
        char*    fname    = "newpic001.oof";  //FILE Name
        char*    path     = "/usr1/win/data"; //DIR  Specify
        char*    parent   = NULL; //A parent instance is not specified because a window is loaded.
        //Specify the directory to read
        WSGIconductor()->setSerializePath(path);

        WSDserialize* db = WSGIconductor()->beginTransaction(stype,fname);
        if (db == NULL){
          return WS_ERR;
        }
        long ret = WSGIconductor()->loadGUI(db,&window,parent);
        long ret2 = WSGIconductor()->endTransaction(db);
      }

### saveGUI Function Description

Form
  long saveGUI(WSDserialize* dest,char* name,WSCbase* inst)
Function
  Output the specified instance to the named serialized source
Description
Parameters

  (in)WSDserialize* dest | Serializing instance
  (in)char* name | Serializing name
  (in)inst | Instance name to be stored

Return value
  WS_NO_ERR= Normal, otherwise error.
Notice
Samples

      #include <WSCconductor.h>
      void sample_proc(WSCbase* object){
        char*    stype    = "FILE";           //FILE Specify
        char*    fname    = "newpic001.oof";  //FILE Name
        char*    path     = "/usr1/win/data"; //DIR  Specify

        //Specify the directory to read
        WSGIconductor()->setSerializePath(path);
        WSDserialize* db = WSGIconductor()->beginTransaction(stype,fname);
        if (db == NULL){
          return WS_ERR;
        }
        WSGIconductor()->saveGUI(db,object->getInstanceName(),object);
        return WSGIconductor()->endTransaction(db);

      }

  ### loadGUI Function Description

  Form
    long loadGUI(WSDserialize* src,WSCbase** inst,WSCbase* parent)
  Function
    Read the instance from the specified serialize source
  Description
  Parameters

    (in)WSDserialize* src | Serialize source instance
    (out)WSCbase** inst | A pointer to the loaded instance
    (in)WSCbase* parent | Parent instance of the reading instance

  Return value
    WS_NO_ERR= Normal, otherwise error
  Notice
  Samples
    Refer to WSGIappConductor() sample

  ### save Function Description

  Form
    long save(WSDserialize* dest, char* type, char* name, void* ptr)
  Function
    Output the specified data to named serialize Used when serializing a normal data type, not only a GUI instance
  Description
  Parameters

    (in)WSDserialize* dest | Serializing instance
    (in)char* type | Data class name
    (in)char* name | Serialize name
    (in)void* data | Output data

  Return value
    WS_NO_ERR= Normal, otherwise error
  Notice
  Samples

        #include <WSCconductor.h>
        void sample_proc(WSCbase* object){
          char*    stype    = "FILE";           //FILE Specify
          char*    fname    = "newpic001.oof";  //FILE Name
          char*    path     = "/usr1/win/data"; //DIR  Specify

          //Directory to read
          WSGIconductor()->setSerializePath(path);
          WSDserialize* db = WSGIconductor()->beginTransaction(stype,fname);
          if (db == NULL){
            return WS_ERR;
          }
          WSGIconductor()->save(db,object->getClassName(),object->getInstanceName(),object);
          return WSGIconductor()->endTransaction(db);

        }

  ### load Function Description

  Form
    long load(WSDserialize* dest, char* type, char* name, void* ptr)
  Function
    Read named data from the specified name serialized source
  Description
  Parameters

    (in)WSDserialize* dest | Serialize source instance
    (in)char* type | Data class name
    (in)char* name | Serialize name
    (in)void* data | Pointer to read data

  Return value
    WS_NO_ERR= Normal, otherwise error
  Notice
  Samples

        #include <WSCconductor.h>
        void sample_proc(WSCbase* object){
          WSCbase* window   = NULL; //Store a return value(loaded application window)
          char*    stype    = "FILE";           //FILE Specify
          char*    fname    = "newpic001.oof";  //FILE Name
          char*    path     = "/usr1/win/data"; //DIR  Specify
          char*    parent   = NULL; //Parent instance is not specified because a window is loaded
          //Specify the read directory
          WSGIconductor()->setSerializePath(path);
          WSDserialize* db = WSGIconductor()->beginTransaction(stype,fname);
          if (db == NULL){
            return WS_ERR;
          }
          WSGIconductor()->save(db,"WSCbase","*",&window,parent);
          return WSGIconductor()->endTransaction(db);
        }

  ### beginTransaction Function Description

  Form
    WSDserialize* beginTransaction(char* stype,char* sname)
  Function
    Start store output specifying a serialize name
  Description
    Obtain a serialize instance for store output
  Parameters

    (in)char* stype | Output type name
    (in)char* sname | Serialize output name

  Return value
    Serialize instance
  Notice
  Samples
    Refer to WSGIappConductor()

  ### endTransaction Function Description

  Form
    WSDserialize* endTransaction(WSDserialize* sr)
  Function
    Complete a store output transaction specifying the serialize instance
  Description
  Parameters

    (in)WSDserialize* sr | Serialize instance

  Return value
    WS_NO_ERR= Normal, otherwise error
  Notice
  Samples
    Refer to WSGIappConductor()

  Document Release 3.70
  For use with Wide Studio Release 3.70, Spring 2004

  Wide Studio Home | Up to

  Copyright(C) WideStudio Development Team, 1999-2004 |  | Last modified: May 25, 2004