Changeset 11695 for trunk/FACT++/dim


Ignore:
Timestamp:
07/29/11 09:54:56 (13 years ago)
Author:
tbretz
Message:
Updated from dim_v19r22 to dim_v19r23
Location:
trunk/FACT++/dim
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/dim/README_v19.txt

    r11121 r11695  
    11
    2                     DIM version 19.22 Release Notes
     2                    DIM version 19.23 Release Notes
    33
    44Notes 1 and 2 for Unix Users only
     
    1717                Dns </dev/null >& dns.log &
    1818
    19 NOTE 3: The Version Number service provided by servers is now set to 1922.
     19NOTE 3: The Version Number service provided by servers is now set to 1923.
     20
     2115/07/2011
     22Changes for version 19.23:
     23    - The new functions:
     24        int DimClient::inCallback()
     25        int DimServer::inCallback()
     26      Can be used to find out if the function is being called in the context of a DIM callback
     27      handler (they return 1 if yes, 0 if no).
     28    - There was no way to "remove" an errorHandler or exitHandler in C++.
     29      Now the following functions accept 0 as parameter:
     30        DimClient::addErrorHandler(0)
     31        DimServer::addErrorHandler(0)
     32        DimServer::addExitHandler(0)
     33        DimServer::addClientExitHandler(0)
     34      In order to remove them.
     35    - The Windows Visual Studio Manifest file distributed since version v19r19 was wrong, so the latest
     36      DIM versions did not work on Windows machines without Visual Studio 8 installed - Fixed.
     37
    2038
    213921/06/2011
  • trunk/FACT++/dim/dim/dic.hxx

    r11071 r11695  
    462462        static void setNoDataCopy();
    463463        static int getNoDataCopy();
     464        static int inCallback();
    464465};
    465466
  • trunk/FACT++/dim/dim/dim.h

    r11121 r11695  
    1414#include "dim_common.h"
    1515
    16 #define DIM_VERSION_NUMBER 1922
     16#define DIM_VERSION_NUMBER 1923
    1717
    1818#define MY_LITTLE_ENDIAN        0x1
  • trunk/FACT++/dim/dim/dis.hxx

    r11071 r11695  
    136136        virtual void serviceHandler() {};
    137137        virtual void commandHandler() {};
     138        static int inCallback();
    138139};
    139140
  • trunk/FACT++/dim/src/diccpp.cxx

    r11071 r11695  
    11111111
    11121112        DimCore::inCallback = 2;
    1113         DimClient::itsCltError->errorHandler(severity, code, msg);
     1113        if(DimClient::itsCltError != 0)
     1114                DimClient::itsCltError->errorHandler(severity, code, msg);
    11141115        DimCore::inCallback = 0;
    11151116}
     
    11181119void DimClient::addErrorHandler(DimErrorHandler *handler)
    11191120{
    1120         DimClient::itsCltError = handler;
    1121         dic_add_error_handler(clt_error_user_routine);
     1121        if(handler == 0)
     1122        {
     1123                dic_add_error_handler(0);
     1124                DimClient::itsCltError = 0;
     1125        }
     1126        else
     1127        {
     1128                DimClient::itsCltError = handler;
     1129                dic_add_error_handler(clt_error_user_routine);
     1130        }
    11221131}
    11231132
     
    12071216        return list;
    12081217}
     1218
     1219int DimClient::inCallback()
     1220{
     1221        if(DimCore::inCallback)
     1222                return 1;
     1223        return 0;
     1224}
  • trunk/FACT++/dim/src/discpp.cxx

    r11071 r11695  
    612612void DimServer::addClientExitHandler(DimClientExitHandler *handler)
    613613{
    614         DimServer::itsClientExit = handler;
    615         dis_add_client_exit_handler(client_exit_user_routine);
     614        if(handler == 0)
     615        {
     616                dis_add_client_exit_handler(0);
     617                DimServer::itsClientExit = 0;
     618        }
     619        else
     620        {
     621                DimServer::itsClientExit = handler;
     622                dis_add_client_exit_handler(client_exit_user_routine);
     623        }
    616624}
    617625
     
    624632void DimServer::addExitHandler(DimExitHandler *handler)
    625633{
    626         DimServer::itsExit = handler;
    627         dis_add_exit_handler(exit_user_routine);
     634        if(handler == 0)
     635        {
     636                dis_add_exit_handler(0);
     637                DimServer::itsExit = 0;
     638        }
     639        else
     640        {
     641                DimServer::itsExit = handler;
     642                dis_add_exit_handler(exit_user_routine);
     643        }
    628644}
    629645
    630646void DimServer::addErrorHandler(DimErrorHandler *handler)
    631647{
    632         DimServer::itsSrvError = handler;
    633         dis_add_error_handler(srv_error_user_routine);
     648        if(handler == 0)
     649        {
     650                dis_add_error_handler(0);
     651                DimServer::itsSrvError = 0;
     652        }
     653        else
     654        {
     655                DimServer::itsSrvError = handler;
     656                dis_add_error_handler(srv_error_user_routine);
     657        }
    634658}
    635659
     
    686710}
    687711
     712int DimServer::inCallback()
     713{
     714        if(DimCore::inCallback)
     715                return 1;
     716        return 0;
     717}
     718
    688719extern "C" {
    689720static void client_exit_user_routine(int *idp)
     
    711742
    712743        DimCore::inCallback = 2;
    713         DimServer::itsSrvError->errorHandler(severity, code, msg);
     744        if(DimServer::itsSrvError != 0)
     745                DimServer::itsSrvError->errorHandler(severity, code, msg);
    714746        DimCore::inCallback = 0;
    715747}
  • trunk/FACT++/dim/src/examples/test_client.cxx

    r11071 r11695  
    3939                        index++;
    4040                }
     41                int inCallback = DimClient::inCallback();
     42                cout << "infoHandler: In callback "<< inCallback << endl;
    4143        }
    4244public :
     
    8385                cout << "Current INTVAL : " << servint.getInt() << endl;
    8486                DimClient::sendCommand("TEST/CMND","UPDATE_STRVAL");
     87                int inCallback = DimClient::inCallback();
     88                cout << "main: In callback "<< inCallback << endl;
     89
     90                DimClient::addErrorHandler(0);
    8591        }
    8692        return 0;
  • trunk/FACT++/dim/src/examples/test_server.cxx

    r11071 r11695  
    183183        }
    184184*/
    185 
    186185        while(1)
    187186        {
    188187                sleep(5);
     188
    189189/*
    190190                while(cmdsvr.hasNext())
     
    200200                        boolval = 0;
    201201                ival++;
     202               
     203                int inCallback = DimServer::inCallback();
     204                cout << "main: In callback "<< inCallback << endl;
    202205                servint.updateService();
    203206                if(extraDns)
Note: See TracChangeset for help on using the changeset viewer.