Back to index

salome-kernel  6.5.0
Defines | Functions
NOTIFICATION.hxx File Reference
#include "SALOME_NOTIFICATION.hxx"
#include "utilities.h"
#include "CosNotifyShorthands.h"
#include "NOTIFICATION_Supplier.hxx"
#include "NOTIFICATION_Consumer.hxx"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define NOTIF_WARNING   "Warning"
#define NOTIF_STEP   "Step"
#define NOTIF_TRACE   "Trace"
#define NOTIF_VERBOSE   "Verbose"
#define NOTIFICATION_ChannelName   "EventChannel"

Functions

NOTIFICATION_EXPORT char * NOTIFICATION_date ()
NOTIFICATION_EXPORT
CosNA_EventChannel_ptr 
NOTIFICATION_channel ()

Define Documentation

#define NOTIF_STEP   "Step"

Definition at line 34 of file NOTIFICATION.hxx.

#define NOTIF_TRACE   "Trace"

Definition at line 35 of file NOTIFICATION.hxx.

#define NOTIF_VERBOSE   "Verbose"

Definition at line 36 of file NOTIFICATION.hxx.

#define NOTIF_WARNING   "Warning"

Definition at line 33 of file NOTIFICATION.hxx.

#define NOTIFICATION_ChannelName   "EventChannel"

Definition at line 38 of file NOTIFICATION.hxx.


Function Documentation

NOTIFICATION_channel() -> CosNA_EventChannel_ptr

Definition at line 33 of file NOTIFICATION.cxx.

                                              {
    ORB_INIT&      init = *SINGLETON_<ORB_INIT>::Instance(); ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
    CORBA::ORB_ptr orb  = init(0, 0);

    CosNA_EventChannel_ptr       channel = CosNA_EventChannel::_nil();
    CosNaming::NamingContext_var name_context;
    CosNaming::Name              name;
    CORBA::Object_var            name_service;

    try {
        name_service = orb->resolve_initial_references("NameService");
        name_context = CosNaming::NamingContext::_narrow(name_service);
        if (CORBA::is_nil(name_context)) {
            MESSAGE("NOTIFICATION Error : failed to obtain context for NameService");
            return(channel);
        };
    } catch(CORBA::ORB::InvalidName& ) {
        MESSAGE("NOTIFICATION Error : service required is invalid [does not exist]");
        return(channel);
    } catch (CORBA::SystemException& ) {
        MESSAGE("NOTIFICATION Error : caught system exception COMM_FAILURE");
        return(channel);
    } catch (...) {
        MESSAGE("NOTIFICATION Error : caught exception while resolving the naming service");
        return(channel);
    }

    name.length(1);
    name[0].id   = CORBA::string_dup((const char*)NOTIFICATION_ChannelName);
    name[0].kind = CORBA::string_dup((const char*)NOTIFICATION_ChannelName);

    try {
        CORBA::Object_var channel_ref = name_context->resolve(name);
        channel = CosNA_EventChannel::_narrow(channel_ref);
        if (CORBA::is_nil(channel)) {
            MESSAGE("NOTIFICATION Error : failed to narrow object found in naming service");
        };
    } catch(CORBA::ORB::InvalidName& ) {
        MESSAGE("NOTIFICATION Error : invalid name");
    } catch (CORBA::SystemException& ) {
        MESSAGE("NOTIFICATION Error : caught system exception COMM_FAILURE while resolving event channel name");
    } catch (...) {
        MESSAGE("NOTIFICATION Error : caught exception while resolving event channel name");
    }

    return(channel);
}

Here is the call graph for this function:

Here is the caller graph for this function:

NOTIFICATION_date() -> char

Definition at line 90 of file NOTIFICATION.cxx.

                          {
    time_t aTime;
    time(&aTime);
    struct tm* temps = localtime(&aTime);

    sprintf(NOTIFICATION_DATE, "%4d %3d %3s %2d %3s %02d:%02d:%02d", 1900+temps->tm_year, temps->tm_mon+1, Mois[temps->tm_mon], temps->tm_mday, JourSemaine[temps->tm_wday], temps->tm_hour, temps->tm_min, temps->tm_sec);

    return(NOTIFICATION_DATE);
}

Here is the caller graph for this function: