Bull DPX/20 Guía de usuario

Busca en linea o descarga Guía de usuario para Software Bull DPX/20. Bull DPX/20 User`s guide Manual de usuario

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 341
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente

Indice de contenidos

Pagina 1 - Bull DPX/20

SC23-2680Bull DPX/20SOMobject Base ToolkitUser’s GuideAIX86 A2 27AQ 01ORDER REFERENCE

Pagina 2

viiiSOMobjects Base Toolkit User’s Guide5.5 Initializing and Uninitializing Objects 5-25. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pagina 3

4-16SOMobjects Base Toolkit User’s GuideContext expression The optional context expression (“context-expr”) in a method declaration indicates whichel

Pagina 4

4-17SOM IDL and the SOM CompilerAn unqualified modifier is associated with the interface it is defined in. An unqualified modifierstatement has the fo

Pagina 5 - About This Book

4-18SOMobjects Base Toolkit User’s GuideFrom the preceding IDL file, modifiers are associated with the following definitions:TypeDef ”::newInt”

Pagina 6 - Who Should Read This Book

4-19SOM IDL and the SOM Compilerdirectinitclasses = “ancestor1, ancestor2, ...” — Specifies the ancestor class(es) whose initializers (anddestructo

Pagina 7 - Contents

4-20SOMobjects Base Toolkit User’s Guidemetaclass = class — Specifies the class’s metaclass. The specified metaclass(or one automatically derived

Pagina 8

4-21SOM IDL and the SOM CompilerThe following paragraphs describe each qualified modifier.caller_owns_parameters = “p1, p2, ..., pn” — Specifies t

Pagina 9

4-22SOMobjects Base Toolkit User’s Guidemethod or nonstatic or procedure — Indicates the category of method implementation. Refer tothe topic “T

Pagina 10

4-23SOM IDL and the SOM CompilerNote: The “set” method procedure that the SOM Compilergenerates by default for an attribute in the .h/.xh binding file

Pagina 11

4-24SOMobjects Base Toolkit User’s Guideoffset or namelookup — Indicates whether the SOM Compiler should generatebindings for invoking the metho

Pagina 12

4-25SOM IDL and the SOM Compilerselect = parent — Used in conjunction with the override modifier, this indi-cates that an inherited static method

Pagina 13

ixPrefaceRunning the application 6-14. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Starting the DSOM

Pagina 14

4-26SOMobjects Base Toolkit User’s GuideEach “literal” is a string literal (enclosed in double quotes) to be placed verbatim into thespecified header

Pagina 15

4-27SOM IDL and the SOM Compilerstatement then causes an appropriate #include statement to be emitted into the C/C++ bindingfile, so that the file def

Pagina 16 - 1.1 Background

4-28SOMobjects Base Toolkit User’s GuideAny number of methods and attributes can be designated as private, either within a single#ifdef or in separate

Pagina 17

4-29SOM IDL and the SOM CompilerQualified names can also take the form:::identifierThese names are resolved by locating the definition of “identifier”

Pagina 18 - The SOM Compiler

4-30SOMobjects Base Toolkit User’s GuideIf you want to verify that an IDL file contains only standard CORBA specifications, the SOMCompiler option –mc

Pagina 19 - The SOM run-time library

4-31SOM IDL and the SOM Compiler4.3 The SOM Compiler The SOM Compiler translates the IDL definition of a SOM class into a set of “binding files”app

Pagina 20 - Metaclass Framework

4-32SOMobjects Base Toolkit User’s Guide<filestem>.h — (produced by the h emitter)This is the header file to be included by C client programs(p

Pagina 21

4-33SOM IDL and the SOM Compiler<filestem>.xh — (produced by the xh emitter)This is the header file to be included by C++ client programsthat us

Pagina 22 - NULL pointers

4-34SOMobjects Base Toolkit User’s Guide<filestem>.exp (for AIX) — (produced by the exp emitter) This file is used by the linker to package a

Pagina 23

4-35SOM IDL and the SOM CompilerBy default, all output files are placed in the same directoryas the input file. If the SMEMIT environment variable is

Pagina 24 - 1.4 Overview of this book

xSOMobjects Base Toolkit User’s GuideMapping objects to object references 6-36. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hint

Pagina 25

4-36SOMobjects Base Toolkit User’s GuideSMKNOWNEXTS — Specifies additional emitters to which the SOM Compilershould add a header. For example, if y

Pagina 26

4-37SOM IDL and the SOM Compiler–V Displays version information about the SOM Compiler.–c Turns off comment processing. This allows comments to appear

Pagina 27

4-38SOMobjects Base Toolkit User’s Guide noint This option directs the SOM Compiler not to warn about the portabilityproblems of using int’s in

Pagina 28

4-39SOM IDL and the SOM CompilerThe –s option is a convenient way to override the SMEMIT environmentvariable. In OS/2 for example, the command:> SC

Pagina 29

4-40SOMobjects Base Toolkit User’s Guide4.4 The ‘pdl’ Facility As discussed earlier in this chapter, the SOM Compiler provides a pdl (Public Definit

Pagina 30 - SMADDSTAR=1 or use the SOM

5-1Implementing Classes in SOMChapter 5. Implementing Classes in SOMThis chapter begins with a more in-depth discussion of SOM concepts and the SOM r

Pagina 31 - ++ function prototypes:

5-2SOMobjects Base Toolkit User’s Guide5.1 The SOM Run-time Environment As discussed in Chapter 1, the SOMobjects Developer Toolkit providesS The SO

Pagina 32 - ++,“hello.C” on AIX

5-3Implementing Classes in SOMThe distinction between instance methods and class methods, as well as that between objects,classes, and metaclasses, is

Pagina 33

5-4SOMobjects Base Toolkit User’s GuideRelationships among the four primitive SOM run-time objects are illustrated in Figure 2.Again, the primitive cl

Pagina 34 - ++ client program is the

5-5Implementing Classes in SOMParent class vs. metaclass There is a distinct difference between the notions of “parent” (or base) class and “metaclass

Pagina 35 - ++ programmers:

xiPrefaceInitiating a Request 6-73. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example code 6-7

Pagina 36 - File extensions for SOM files

5-6SOMobjects Base Toolkit User’s GuideAny class “C” has both a metaclass and one or more parent class(es).SThe parent class(es) of “C” provide the

Pagina 37

5-7Implementing Classes in SOMA metaclass has its own inheritance hierarchy (through its parent classes) that is independentof its instances’ inherita

Pagina 38

5-8SOMobjects Base Toolkit User’s GuideSOM-derived metaclasses As previously discussed, a class object can perform any of the class methods that its

Pagina 39

5-9Implementing Classes in SOMThere is only one way that “BMeta” can support this specific method — by inheriting it from“AMeta” (“BMeta” could introd

Pagina 40 - ++ preprocessor commands that

5-10SOMobjects Base Toolkit User’s GuideBMetaAMetaLegend:subclass–ofinstance–ofmetaclass class simple objectMultiple inheritance in SOM requir

Pagina 41

5-11Implementing Classes in SOM5.2 Inheritance One of the defining aspects of an object model is its characterization of inheritance. This sectionde

Pagina 42

5-12SOMobjects Base Toolkit User’s GuideClass “W”Class “X”Class “Y”Class “Z”Resolution of multiple-inheritance ambiguitiesfoo proc1fo

Pagina 43

5-13Implementing Classes in SOMAnother conflict that may arise with the use of multiple inheritance is when two ancestors of aclass define different m

Pagina 44

5-14SOMobjects Base Toolkit User’s Guide5.3 Method Resolution Method resolution is the step of determining which procedure to execute in response to

Pagina 45

5-15Implementing Classes in SOMName-lookup resolution Name-lookup resolution is similar to the method resolution techniques employed by Objec-tive-C

Pagina 46

xiiSOMobjects Base Toolkit User’s GuideExamples of using other events 9-5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pagina 47 - ++ programmers

5-16SOMobjects Base Toolkit User’s GuideThe four kinds of SOM methods SOM supports four different kinds of methods: static methods, nonstatic method

Pagina 48

5-17Implementing Classes in SOM5.4 Implementing SOM Classes The interface to a class of objects contains the information that a client must know t

Pagina 49

5-18SOMobjects Base Toolkit User’s GuideFrom this IDL description, the SOM Compiler generates the following C implementation tem-plate, hello.c (a C++

Pagina 50

5-19Implementing Classes in SOMUnless the IDL specification of the class included the callstyle=oidl modifier, then the formalparameter list will incl

Pagina 51 - Declaring object variables

5-20SOMobjects Base Toolkit User’s GuideS For overriding methods, the stub procedure ends by making a “parent method call” foreach of the class’s pare

Pagina 52

5-21Implementing Classes in SOMThe SOM-generated implementation header file defines the following macros for makingparent-method calls from within an

Pagina 53

5-22SOMobjects Base Toolkit User’s GuideS Similarly left intact are preprocessor directives, data declarations, constant declarations,non-method funct

Pagina 54

5-23Implementing Classes in SOMConditional compilation (using #if and #ifdef directives) in the implementation file can beanother source of errors, be

Pagina 55 - Invoking methods on objects

5-24SOMobjects Base Toolkit User’s GuideWhen the client program and the implementation file are written in C++:> set LIB=%SOMBASE%\lib;%LIB%> ic

Pagina 56 - CORBA standard

5-25Implementing Classes in SOM5.5 Initializing and Uninitializing Objects This section discusses the initialization and uninitialization of SOM obj

Pagina 57 - CORBA standard, use the

1-1Introduction to the SOMobjects ToolkitChapter 1. Introduction to the SOMobjects Toolkit

Pagina 58 - ++ programs with

5-26SOMobjects Base Toolkit User’s GuideEvery SOM class has a list that defines (in sequential order) the ancestor classes whoseinitializer method pro

Pagina 59 - Using ‘va_list’ methods

5-27Implementing Classes in SOMDeclaring new initializers in SOM IDL When defining SOMobjects classes, programmers can easily declare and implement

Pagina 60

5-28SOMobjects Base Toolkit User’s GuideHere, interface “Example1” declares three new initializers. Notice the use of inout somInitCtrlas the first ar

Pagina 61

5-29Implementing Classes in SOMFor a number of reasons, the somInit framework has been augmented by recognizing initializ-ers as a special kind of met

Pagina 62 - A name-lookup example

5-30SOMobjects Base Toolkit User’s Guide /* * second section –– local Example2 initialization code */}In this example, notice that the “Ex

Pagina 63

5-31Implementing Classes in SOMUsage bindings hide the details associated with initializer use in various ways and make callsmore convenient for the c

Pagina 64

5-32SOMobjects Base Toolkit User’s GuideOn the other hand, if an object is initially created by allocating memory in some special way andsubsequently

Pagina 65 - ++ usage bindings

5-33Implementing Classes in SOMImplementation codeBased on the foregoing class definitions, the next example illustrates several important aspectsof i

Pagina 66 - Using class objects

5-34SOMobjects Base Toolkit User’s GuideSOM_Scope void SOMLINK BBwithInitialValue(B *somSelf, somInitCtrl* ctrl, long initialValue)

Pagina 67 - Creating a class object

5-35Implementing Classes in SOMSOM_Scope void SOMLINK CCwithInitialString(C *somSelf, Environment *ev,

Pagina 68 - , or when the

1-2SOMobjects Base Toolkit User’s Guide1.1 Background Object-oriented programming (or OOP) is an important new programming technologythat offers exp

Pagina 69

5-36SOMobjects Base Toolkit User’s GuideSOM_Scope SOMObject* SOMLINK CsomPrintSelf(C *somSelf){ CData *somThis = CGetData(somSelf); CMethodDebu

Pagina 70

5-37Implementing Classes in SOM c = new C((Environment*)0, ”66”); c–>somPrintSelf(); delete c;}The output from the preceding program is as

Pagina 71 - Generating output

5-38SOMobjects Base Toolkit User’s GuideCustomizing the initialization of class objects As described previously, the somDefaultInit method can be ove

Pagina 72

5-39Implementing Classes in SOM5.6 Creating a SOM Class Library One of the principal advantages of SOM is that it makes “black box” (or binary) reu

Pagina 73 - Functions

5-40SOMobjects Base Toolkit User’s GuideTypes of class librariesSince class libraries are not programs, users cannot execute them directly. To enable

Pagina 74 - Debugging

5-41Implementing Classes in SOMAIX “exp” file: #! abc.dll ACClassData AClassData ANewClass BCClassData BClassData BNewClass CCClassDat

Pagina 75 - TRUE and

5-42SOMobjects Base Toolkit User’s GuideOne class in the affinity group has a privileged position — namely, the class that was specifical-ly requested

Pagina 76 - Exception declarations

5-43Implementing Classes in SOM #include <windows.h> int CALLBACK LibMain (HINSTANCE inst, WORD ds, WORD Heapsize, LPSTR cmdLine) {

Pagina 77 - The Environment

5-44SOMobjects Base Toolkit User’s GuideNote: The “–Ge” option is not used by all the compilers. It indicates that the object files will gointo a DLL.

Pagina 78 - Getting an exception value

5-45Implementing Classes in SOMFor Windows: link a.obj b.obj c.obj initfunc.obj, abc.dll, nul, \ ldllcew libw %SOMBASE%\somtk, abc.defNote:

Pagina 79

1-3Introduction to the SOMobjects Toolkit1.2 Introducing SOM and the SOMobjects Toolkit The System Object Model (SOM) is a new object-oriented progr

Pagina 80

5-46SOMobjects Base Toolkit User’s Guide5.7 Customizing Memory Management SOM is designed to be policy free and highly adaptable. Most of the SOM b

Pagina 81

5-47Implementing Classes in SOM5.8 Customizing Class Loading and Unloading SOM uses three routines that manage the loading and unloading of class

Pagina 82

5-48SOMobjects Base Toolkit User’s GuideminorVersion — The minor version number to be passed to the class initial-ization function in the DLL (specifi

Pagina 83

5-49Implementing Classes in SOM5.9 Customizing Character Output The SOM character-output function is invoked by all of the SOM error-handling and

Pagina 84

5-50SOMobjects Base Toolkit User’s Guide5.10 Customizing Error Handling When an error occurs within any of the SOM-supplied methods or functions,

Pagina 85

5-51Implementing Classes in SOM5.11 Customizing Mutual Exclusion Services (Thread Safety) The SOM kernel and the other SOMobjects frameworks (DSOM, P

Pagina 86 - CORBA

5-52SOMobjects Base Toolkit User’s GuideThe referenced function returns a small integer identifier for the calling thread. The IDcannot be associated

Pagina 87 - CORBA standard)

6-1Distributed SOM (DSOM)Chapter 6. Distributed SOM (DSOM)

Pagina 88 - Include directives

6-2SOMobjects Base Toolkit User’s Guide6.1 IntroductionNotice: The SOMobjects Base Toolkit provides the capability for implementing WorkstationDSOM (

Pagina 89 - TRUE and FALSE

6-3Distributed SOM (DSOM)• Provides support for writing multi-threaded (on OS/2 and AIX) and event-driven programs.• Provides a default object server

Pagina 90

1-4SOMobjects Base Toolkit User’s GuideS Name-lookup resolution: similar to that employed by Objective-C and Smalltalk.Name resolution supports untyp

Pagina 91

6-4SOMobjects Base Toolkit User’s GuideAdvanced topicsThe section on “Advanced Topics” covers the following:• “Peer vs. client-server processes” demon

Pagina 92 - _IDL_SEQUENCE_long

6-5Distributed SOM (DSOM)6.2 A Simple DSOM Example A sample “Stack” application is presented in this section as a tutorial introduction to DSOM. Itd

Pagina 93 - Object types

6-6SOMobjects Base Toolkit User’s GuideThe “Stack” class implementation#define Stack_Class_Source#include <stack.ih>SOM_Scope boolean SOMLINK f

Pagina 94

6-7Distributed SOM (DSOM)SOM_Scope void SOMLINK push(Stack somSelf, Environment *ev, long el){ StackData *somThis = S

Pagina 95 - Interface declarations

6-8SOMobjects Base Toolkit User’s Guide /* Verify successful object creation */ if ( stk != NULL ) { while ( !_full(stk, &ev) ) {_push(

Pagina 96

6-9Distributed SOM (DSOM)Client program using a remote stackThe preceding program has been rewritten below to use DSOM to create and access a “Stack”o

Pagina 97 - Attribute declarations

6-10SOMobjects Base Toolkit User’s Guideboolean OperationOK(Environment *ev){ char *exID; switch (ev–>_major) { case SYSTEM_EXCEPTION:

Pagina 98 - Parameter list

6-11Distributed SOM (DSOM)From this point on, the client program treats the “Stack” proxy exactly as it would treat a local“Stack”. The “Stack” proxy

Pagina 99 - Raises expression

6-12SOMobjects Base Toolkit User’s Guide_pop(stk,&ev);if (!_empty(stk,&ev)) somPrintf(”Top: %d\n”, _top(stk,&ev));_somdDeleteObj(server, &

Pagina 100 - Implementation statements

6-13Distributed SOM (DSOM)An application may require more functionality in the server program or the server object than thedefault implementations pro

Pagina 101 - : modifier = value

1-5Introduction to the SOMobjects ToolkitBindings are language-specific macros and procedures that make implementing and usingSOM classes more conveni

Pagina 102 - CORBA-specifie

6-14SOMobjects Base Toolkit User’s GuideSOMIR gives a list of files that together constitute the Interface Repository. The IR is used byDSOM to guide

Pagina 103 - SOM IDL and the SOM Compiler

6-15Distributed SOM (DSOM)Running the clientOnce the DSOM daemon is running, the application may be started. This is accomplished byrunning the client

Pagina 104

6-16SOMobjects Base Toolkit User’s GuideThis scenario has introduced the key processes in a DSOM application: client, server, andsomdd. Also introduce

Pagina 105

6-17Distributed SOM (DSOM)6.3 Basic Client Programming For the most part, client programming in DSOM is exactly the same as client programming inSO

Pagina 106

6-18SOMobjects Base Toolkit User’s GuideNote: In non-distributed SOM programs, the <className>New macro (and the new operatorprovided for each c

Pagina 107

6-19Distributed SOM (DSOM)• A server can create an object and register a reference to the object in some well-knowndirectory. (An object reference con

Pagina 108

6-20SOMobjects Base Toolkit User’s GuideProxy objects inherit behavior from the SOMDClientProxy class.Servers and server objects In DSOM, the proces

Pagina 109 - Passthru statements

6-21Distributed SOM (DSOM)Three other methods can be invoked on the DSOM Object Manager to find server implementa-tions: somdFindServer, somdFindServe

Pagina 110

6-22SOMobjects Base Toolkit User’s GuideDestroying objects via a proxy DSOM provides means for deleting remote objects via their proxies. For exampl

Pagina 111

6-23Distributed SOM (DSOM)Destroying objects via the server object, rather than asking the object itself (as in somFree orsomdTargetFree), allows the

Pagina 113 - Name usage in client programs

1-6SOMobjects Base Toolkit User’s GuidePersistence Framework The Persistence Framework is a collection of SOM classes that provide methods forsaving

Pagina 114 - ++ approach. For example:

6-24SOMobjects Base Toolkit User’s Guide#include <stdio.h>#include <somd.h>#include <Car.h>main( ) { Environment ev; Car car;

Pagina 115 - 4.3 The SOM Compiler

6-25Distributed SOM (DSOM)Upon a lookup call, the directory server could find the corresponding proxy (or its string ID) in thedirectory, and return i

Pagina 116 - SOMBASE>/include/ctm.efw

6-26SOMobjects Base Toolkit User’s GuideDetermining memory allocation and ownership When a method is invoked that returns a result of type string, se

Pagina 117 - PRIVATE__” and “#en

6-27Distributed SOM (DSOM)For example, when a method is invoked that returns a result of type string, sequence, or array,DSOM will allocate memory for

Pagina 118 - ++ binding files

6-28SOMobjects Base Toolkit User’s GuideAllocation responsibilitiesWhether the parameter or return result should be allocated by the caller or by the

Pagina 119

6-29Distributed SOM (DSOM)For example, consider a client program repeatedly invoking a remote method “get_string”,which returns a string that is desig

Pagina 120 - Running the SOM Compiler

6-30SOMobjects Base Toolkit User’s Guide6.4 Basic Server Programming Server programs execute and manage object implementations. That is, they are r

Pagina 121 - *’ added to them for the

6-31Distributed SOM (DSOM)When a server is initialized, it must retrieve a copy of its ImplementationDef, and keep it in aglobal variable (SOMD_ImplDe

Pagina 122

6-32SOMobjects Base Toolkit User’s GuideAIX users should be aware that, unless the SetUserID mode bit is set on the file containing theserver program,

Pagina 123 - FALSE)

6-33Distributed SOM (DSOM)The SOMOA will then set up a communications port for incoming messages, which it registerswith the DSOM daemon. Once the DSO

Pagina 124 - 4.4 The ‘pdl’ Facility

1-7Introduction to the SOMobjects Toolkit1.3 What’s New in SOMobjects Version 2.1 Version 2.1 of the SOMobjects Developer Toolkit provides enhanced

Pagina 125 - Implementing Classes in SOM

6-34SOMobjects Base Toolkit User’s GuideTo notify DSOM when the server program is exiting, the deactivate_impl method defined onSOMOA should be called

Pagina 126 - SOMClass class object

6-35Distributed SOM (DSOM)/* From the SOMOA interface */ sequence <octet,1024> Referencedata; SOMDObject create(in ReferenceData id, in Inte

Pagina 127

6-36SOMobjects Base Toolkit User’s GuideFollowing are the IDL declarations of the SOMDServer operations:// methods called by a client SOMObject somd

Pagina 128 - Objects created during SOM

6-37Distributed SOM (DSOM)Two calls to create with the same arguments do not return the same SOMDObject (per CORBA1.1 specifications). That is, if cre

Pagina 129 - Parent class vs. metaclass

6-38SOMobjects Base Toolkit User’s GuideDispatching a method After SOMOA (with the help of the local server object) has resolved all the SOMDObjects

Pagina 130

6-39Distributed SOM (DSOM)The following two procedures override SOMDServer’s implementations of somdCreateObjand somdDeleteObj.SOM_Scope SOMObject SOM

Pagina 131

6-40SOMobjects Base Toolkit User’s GuideMethod somdRefFromSOMObj is responsible for producing a SOMDObject (the “Ref” insomdRefFromSOMObj) from a SOMO

Pagina 132 - SOM-derived metaclasses

6-41Distributed SOM (DSOM)Currently, the value of the userName attribute is obtained from the USER environment variablein the calling process. Likewis

Pagina 133

6-42SOMobjects Base Toolkit User’s Guide6.5 Implementing Classes DSOM has been designed to work with a wide range of object implementations, includi

Pagina 134

6-43Distributed SOM (DSOM)Implementation constraints The generic server program (somdsvr), the SOMOA, and the SOMDServer make it easy touse SOM clas

Pagina 135 - 5.2 Inheritance

1-8SOMobjects Base Toolkit User’s Guide• New SOM IDL modifiers for memory management of parameters:memory_management = corba, caller_owns_parameters,

Pagina 136

6-44SOMobjects Base Toolkit User’s GuideSome applications may need to associate specific identification information with an object, tosupport applicat

Pagina 137

6-45Distributed SOM (DSOM)Note that the “Printer” interface defines one attribute, “printerName”, that will be used to identifythe printer. It will be

Pagina 138 - 5.3 Method Resolution

6-46SOMobjects Base Toolkit User’s GuideSee the section entitled “Implementation Statements” in Chapter 4, “SOM IDL and the SOMCompiler,” for a comple

Pagina 139 - Name-lookup resolution

6-47Distributed SOM (DSOM)6.6 Configuring DSOM Applications Preparing the environment Some environment variables must be defined before running DSO

Pagina 140 - Direct-call procedures

6-48SOMobjects Base Toolkit User’s GuideSOMDDEBUG=<integer> — SOMDDEBUG may optionally be set to enable DSOM run-time error messages. If set to

Pagina 141 - The implementation template

6-49Distributed SOM (DSOM)— Optionally, the server program can be run under control of a “shell” or debugger,by specifying the shell or debugger name

Pagina 142 - ++) includes

6-50SOMobjects Base Toolkit User’s GuideThis brings up the DSOM Implementation Registration Utility menu, shown below. To beginregistering the new imp

Pagina 143

6-51Distributed SOM (DSOM)================================================================Implementation id...: 2befc82b–13a11e00–7f–00–10005ac9

Pagina 144 - Making parent method calls

6-52SOMobjects Base Toolkit User’s GuideTo add an implementation:regimpl –A –i <str> [–p <str>] [–v <str>] [–f <str>] [–b <

Pagina 145

6-53Distributed SOM (DSOM)To work with an implementation definition, first click Implementations on the main menu (orpress Alt–I). The pulldown menu

Pagina 146

1-9Introduction to the SOMobjects ToolkitIn addition, use of a number of (public) methods introduced by SOMClass is nowdeprecated because they are use

Pagina 147 - Compiling and linking

6-54SOMobjects Base Toolkit User’s GuideTo delete classes, select Delete from the Classes pulldown menu (or press D). When youhighlight an implementa

Pagina 148

6-55Distributed SOM (DSOM)void add_class_to_impldef (in ImplId implid, in string classname);— Associates a class, identified by name, wi

Pagina 149 - Initializer methods

6-56SOMobjects Base Toolkit User’s GuideInterpretation of ‘dsom’ messagesThe messages generated by the dsom utility have a one-to-one mapping on the D

Pagina 150

6-57Distributed SOM (DSOM)On AIX or OS/2, the program is invoked from the command line using the syntax given below.The optional verbose setting can b

Pagina 151

6-58SOMobjects Base Toolkit User’s Guide6.7 Running DSOM Applications Prior to starting the DSOM processes, the DSOM executables should be installe

Pagina 152

6-59Distributed SOM (DSOM)6.8 DSOM as a CORBA-compliant Object Request Broker The Object Management Group (OMG) consortium defines the notion of an O

Pagina 153 - Implementing initializers

6-60SOMobjects Base Toolkit User’s GuideORB — (Object Request Broker) The ORB interface defines utilityroutines for building requests and saving

Pagina 154 - ++ clients would

6-61Distributed SOM (DSOM)The Basic Object Adapter is intended to be a general-purpose Object Adapter available on all CORBA-compliantObject Request B

Pagina 155 - Uninitialization

6-62SOMobjects Base Toolkit User’s Guide SOMDClientProxy SOMDObject “Stack”“Stack__Proxy”...abstract inheritance(interface only)Construction of a

Pagina 156 - A complete example

6-63Distributed SOM (DSOM)SOMDObject methods:SOMDObject duplicate ( ); — Creates and returns a duplicate object reference.void release ( ); — De

Pagina 157 - Implementation code

1-10SOMobjects Base Toolkit User’s Guide1.4 Overview of this bookThis book is a subset of the SOMobjects Developer Toolkit Users Guide for thefull-ca

Pagina 158

6-64SOMobjects Base Toolkit User’s GuideServers are processes that execute object implementations. CORBA 1.1 defines four activationpolicies for serv

Pagina 159

6-65Distributed SOM (DSOM)DSOM provides a SOM Object Adapter, SOMOA, derived from the BOA interface, that usesSOM Compiler and run-time support to acc

Pagina 160

6-66SOMobjects Base Toolkit User’s Guide• The SOMOA provides some specialized object reference types which, in certain situations,are more efficient o

Pagina 161

6-67Distributed SOM (DSOM)6.9 Advanced Topics Peer vs. client-server processes The client-server model of distributed computing is appropriate when

Pagina 162

6-68SOMobjects Base Toolkit User’s GuideDSOM server programs which use EMan must be very careful not to get into deadlock situa-tions. This is quite e

Pagina 163 - OMG CORBA standard

6-69Distributed SOM (DSOM)MyEMan = SOMEEManNew();SOM_InitEnvironment(&ev);SOM_InitEnvironment(&peerEv);SOMD_Init(&ev);somPrintf(”What is t

Pagina 164 - Building export files

6-70SOMobjects Base Toolkit User’s Guide• Start the EMan event processing loop._someProcessEvents(MyEMan, &ev);Before the sample is run, two serve

Pagina 165

6-71Distributed SOM (DSOM)len is the number of bytes that the argument value occupies. The following table gives thelength of data values for the C l

Pagina 166 - Using Windows class libraries

6-72SOMobjects Base Toolkit User’s Guide// get the contents of an element in an NVList ORBStatus get_item(in long item_number, /* element # to get *

Pagina 167

6-73Distributed SOM (DSOM)The arg_list can be constructed using the procedures described above and is passed to theRequest object in the create_reques

Pagina 168

2-1Tutorial for Implementing SOM ClassesChapter 2. Tutorial for Implementing SOM ClassesThis tutorial contains five examples showing how SOM classes

Pagina 169

6-74SOMobjects Base Toolkit User’s Guidemain(){ ORBStatus rc; Environment ev; SOMDObject obj; NVList arglist; NamedValue result; Context c

Pagina 170 - Return type Argument types

6-75Distributed SOM (DSOM)To build a user-supplied proxy class, it is necessary to understand a bit about how dynamicproxy classes are constructed by

Pagina 171 - Customizing DLL loading

6-76SOMobjects Base Toolkit User’s GuideThe implementation of “method1”, which was added to the template produced by the SOMCompiler, simply calls the

Pagina 172 - Customizing DLL unloading

6-77Distributed SOM (DSOM)Alternatively, it is possible to provide a customized base proxy class for use in the dynamicgeneration of DSOM proxy classe

Pagina 173

6-78SOMobjects Base Toolkit User’s Guide6.10 Error Reporting and TroubleshootingError reporting When the DSOM run-time environment encounters an er

Pagina 174

6-79Distributed SOM (DSOM)2. For all application classes, IDL must be compiled into the Interface Repository. Youcan verify that a class exists in the

Pagina 175

6-80SOMobjects Base Toolkit User’s GuideSymptom: A remote method invocation fails and a “DISPATCH” exception is returned. TheDSOM error code is SOMDE

Pagina 176

6-81Distributed SOM (DSOM)To correctly pass strings or array arguments, the appropriate CORBA type should be used(for example, “string” or “char foo[4

Pagina 177 - Distributed SOM (DSOM)

6-82SOMobjects Base Toolkit User’s Guide6.11 LimitationsThe following list indicates known limitations of Distributed SOM at the time of this release

Pagina 178 - 6.1 Introduction

7-1The Interface Repository FrameworkChapter 7. The Interface Repository Framework

Pagina 179 - Chapter outline

2-2SOMobjects Base Toolkit User’s Guide2.1 Basic Concepts of the System Object Model (SOM)The System Object Model (SOM), provided by the SOMobjects D

Pagina 180 - Advanced topics

7-2SOMobjects Base Toolkit User’s Guide7.1 IntroductionThe SOM Interface Repository (IR) is a database that the SOM Compiler optionally creates andma

Pagina 181 - 6.2 A Simple DSOM Example

7-3The Interface Repository Framework7.2 Using the SOM Compiler to Build an Interface Repository The SOMobjects Toolkit includes an Interface Reposi

Pagina 182

7-4SOMobjects Base Toolkit User’s Guide7.3 Managing Interface Repository files Just as the number of interface definitions contained in a single IDL

Pagina 183

7-5The Interface Repository FrameworkThe Interface Repository Framework only permits updates in the rightmost file of the SOMIRinterface repository li

Pagina 184

7-6SOMobjects Base Toolkit User’s GuideThis command will place all of the information in the “myclass1.idl” file, including the privateportions, in th

Pagina 185

7-7The Interface Repository Framework7.4 Programming with the Interface Repository Objects The SOM Interface Repository Framework provides an obje

Pagina 186 - NULL is returned and an

7-8SOMobjects Base Toolkit User’s GuideRepository — One instance of this class exists for the entire SOM Inter-face Repository, to hold IDL elements t

Pagina 187 - Using specific servers

7-9The Interface Repository FrameworkS AttributeDef class method:— Overrides describe.S OperationDef class method:— Overrides describe.S ParameterDef

Pagina 188 - — there are no methods that

7-10SOMobjects Base Toolkit User’s GuideFrom other languages (and for dynamic linkage in C/C++):1. Use the somEnvironmentNew function to obtain a poin

Pagina 189 - Compiling the application

7-11The Interface Repository Framework for (i=0; i<everyObject._length; i++) { Contained aContained; (*next)++;aContained = (Conta

Pagina 190 - Running the application

2-3Tutorial for Implementing SOM ClassesS A class that defines the implementation of class objects is called a metaclass. Just as aninstance of a clas

Pagina 191 - Running the client

7-12SOMobjects Base Toolkit User’s GuideConceptually, every TypeCode contains a “kind” field (which classifies it), and one or moreparameters that car

Pagina 192

7-13The Interface Repository Frameworkexception Bounds {}; // This exception is returned if an attempt is made// by the parameter() operation (descri

Pagina 193 - DSOM Object Manager

7-14SOMobjects Base Toolkit User’s GuideTo provide alignment information for the types and instances of types in your IDL source file, usethe “align=N

Pagina 194 - Creating remote objects

7-15The Interface Repository FrameworkThe implementation context string can be used to carry an arbitrarily long description thatidentifies the contex

Pagina 195 - Proxy objects

7-16SOMobjects Base Toolkit User’s GuideIn many cases, the context in which an operation occurs makes the type of the datum apparent.If so, there is n

Pagina 196 - Servers and server objects

8-1The Metaclass FrameworkChapter 8. The Metaclass Framework In SOM, classes are objects. Metaclasses are classes and thus are objects, too. Figure 1

Pagina 197 - Destroying remote objects

8-2SOMobjects Base Toolkit User’s GuideMetaclass Framework class organizationLegend:subclass–ofinstance–ofmetaclass class ordinary objectSOMC

Pagina 198

8-3The Metaclass Framework8.1 Framework Metaclasses for “Before/After” Behavior The ‘SOMMBeforeAfter’ metaclassSOMMBeforeAfter is a metaclass that al

Pagina 199

8-4SOMobjects Base Toolkit User’s GuideThe following example shows the IDL needed to create a Barking metaclass. Just run theappropriate emitter to ge

Pagina 200 - Finding existing objects

8-5The Metaclass FrameworkComposition of before/after metaclassesConsider Figure 4 in which there are two before/after metaclasses — “Barking” (as bef

Pagina 201 - Finding server objects

2-4SOMobjects Base Toolkit User’s GuideSOM classes are designed to be language neutral. That is, SOM classes can be implementedin one programming lang

Pagina 202 - Memory management

8-6SOMobjects Base Toolkit User’s GuideFigure 6 combines the diagrams for the techniques in Figure 5 and shows the actual classrelationships. Note tha

Pagina 203

8-7The Metaclass Framework8.2 The ‘SOMMSingleInstance’ Metaclass Sometimes it is necessary to define a class for which only one instance can be cre

Pagina 204

8-8SOMobjects Base Toolkit User’s Guide8.3 The ‘SOMMTraced’ Metaclass SOMMTraced is a metaclass that facilitates tracing of method invocati

Pagina 205 - ++, “somd.xh”) in addition to

8-9The Metaclass FrameworkThe example below shows the IDL needed to create a traced dog class: Just run the appropriateemitter to get an implementatio

Pagina 206 - Server run-time objects

8-10SOMobjects Base Toolkit User’s Guide8.4 Error Codes It is possible to receive the following messages from the Metaclass Framework while anapplic

Pagina 207 - Server activation

9-1The Event Management FrameworkChapter 9. The Event Management Framework The Event Management Framework is a central facility for registering all

Pagina 208 - Initializing a server program

9-2SOMobjects Base Toolkit User’s Guide9.1 Event Management Basics The Event Management Framework consists of an Event Manager (EMan) class, a Regi

Pagina 209 - Exiting a server program

9-3The Event Management FrameworkThe Event Management Framework is extendible (that is, other event types can be added to it)through subclassing. The

Pagina 210 - SOMDERROR_WMQUIT

9-4SOMobjects Base Toolkit User’s Guide#ifndef H_EVENTMASKDEF#define H_EVENTMASKDEF/* Event Types */#define EMTimerEvent 54#define

Pagina 211

9-5The Event Management FrameworkUnregistering for events One can unregister interest in a given event type at any time. To unregister, you must pro

Pagina 212

2-5Tutorial for Implementing SOM ClassesDevelopment of the Tutorial examplesS Example 1 — Implementing a simple class with one methodPrints a default

Pagina 213

9-6SOMobjects Base Toolkit User’s GuideAn equivalent way to process events is to write a main loop and call someProcessEvent frominside the main loop,

Pagina 214 - Dispatching a method

9-7The Event Management Framework9.2 Event Manager Advanced Topics Threads and thread safety As indicated earlier, on OS/2, interactive programs

Pagina 215

9-8SOMobjects Base Toolkit User’s GuideMaking EMan recognize the occurrence of the new event is primarily limited by the primitiveevents EMan can wait

Pagina 216

9-9The Event Management Framework9.3 Limitations The present implementation of the Event Management framework has the limitations describedbelow. F

Pagina 217 - HOSTNAME

9-10SOMobjects Base Toolkit User’s Guide

Pagina 218 - 6.5 Implementing Classes

A-1SOMobjects Error CodesAppendix A. SOMobjects Error Codes

Pagina 219 - Implementation constraints

A-2SOMobjects Base Toolkit User’s GuideSOM Kernel Error Codes Following are error codes with messages/explanations for the SOM kernel and the variou

Pagina 220 - Wrapping a printer API

A-3SOMobjects Error CodesDSOM Error Codes The following table lists the error codes that may be encountered when using DSOM. (Obsoletemessages have

Pagina 221 - Parameter memory management

A-4SOMobjects Base Toolkit User’s Guide30047 SOMDERROR_ClassNotFoundClass not found in implementation repository.30048 SOMDERROR_ServerNotFoundServer

Pagina 222

A-5SOMobjects Error Codes30097 SOMDERROR_NamedMemoryTableError On Windows only, an error occurred while creating or deleting a (named) sh

Pagina 223 - Preparing the environment

Bull DPX/20SOMobject Base ToolkitUser’s GuideAIXSoftwareJune 1995BULL S.A. CEDOCAtelier de ReproductionFRAN–231331 Avenue Patton BP 42849005 ANGERS CE

Pagina 224 - Implementation definitions

2-6SOMobjects Base Toolkit User’s Guide2.2 Basic Steps for Implementing SOM Classes Implementing and using SOM classes in C or C++ involves the foll

Pagina 225

A-6SOMobjects Base Toolkit User’s Guide

Pagina 226 - IMPLEMENTATION OPERATIONS

B-1SOM IDL Language GrammarAppendix B. SOM IDL Language Grammar specification : [comment] definition+definition : type_dcl ; [commen

Pagina 227 - section, select “7.Add”:

B-2SOMobjects Base Toolkit User’s Guideunary_expr : unary_operator primary_expr | primary_exprunary_operator : –

Pagina 228

B-3SOM IDL Language Grammarunsigned_int : unsigned signed_intchar_type : charboolean_type : booleanoctet_type : octet

Pagina 229

B-4SOMobjects Base Toolkit User’s Guidecontext_expr : context ( context_string {, context_string}* )implementation_body : implementation [comme

Pagina 230

C-1Implementing Sockets SubclassesAppendix C. Implementing Sockets Subclasses Distributed SOM (DSOM) requires basic message services for inter-proces

Pagina 231

C-2SOMobjects Base Toolkit User’s Guide• Some of the method parameters and return values are expressed using pointer types, forexample:hostent *somsGe

Pagina 232

C-3Implementing Sockets Subclassesunsigned long somsGethostid ();// Returns the unique identifier for the current host.long somsGethostname (in string

Pagina 233 - SOMDCHK icon

C-4SOMobjects Base Toolkit User’s Guideunsigned long somsNtohl (in unsigned long a);// Translates an unsigned long integer from network–byte order// t

Pagina 234 - Running DSOM servers

C-5Implementing Sockets Subclasses#ifdef __SOMIDL__ implementation {releaseorder:somsAccept, somsBind, somsConnect, somsGethostbyaddr,somsGethos

Pagina 235

2-7Tutorial for Implementing SOM ClassesExample 1 — Implementing a Simple Class with One Method Example 1 defines a class “Hello” which introduces o

Pagina 236 - SOMD_ORBObject

C-6SOMobjects Base Toolkit User’s Guide//# Method modifierssomsAccept: override;somsBind: override;somsConnect: override;somsGethostbyaddr: override;s

Pagina 237 - CORBA 1.1

C-7Implementing Sockets SubclassesExample code The following code fragment shows an example of the implementation of the somsBindmethod of the TCPIP

Pagina 238

C-8SOMobjects Base Toolkit User’s GuideSOM_Scope long SOMLINK somsBind(TCPIPSockets somSelf, Environment *ev,

Pagina 239

G–1GlossaryGlossaryNote: In the following definitions, words shown in italics are terms for which separate glossaryentries are also defined.abstract

Pagina 240 - Object Adapters

G–2SOMobjects Base Toolkit User’s Guidebindings Language-specific macros and procedures that make implementing and usingSOM classes more convenient. T

Pagina 241 - Extensions and limitations

G–3Glossaryclass method (Also known as factory method or constructor.) A class method is a methodthat a class object responds to (as opposed to an in

Pagina 242

G–4SOMobjects Base Toolkit User’s Guidedispatch methodA method (such as somDispatch or somClassDispatch) that is invoked (andpassed an argument list a

Pagina 243 - 6.9 Advanced Topics

G–5Glossaryevent manager (EMan) The chief component of the Event Management Framework that registersinterest in various events from calling modules a

Pagina 244 - Sample server using EMan

G–6SOMobjects Base Toolkit User’s Guideinheritance The technique of defining one class (called a subclass, derived class, or childclass) as increment

Pagina 245

G–7GlossaryInterface Repository FrameworkA set of classes that provide methods whereby executing programs canaccess the persistent objects of the In

Pagina 246 - The NamedValue structure

2-8SOMobjects Base Toolkit User’s GuideUnder AIX or OS/2:#include <hello.ih>/* * This method outputs the string ”Hello, World!”. */SOM_Scope vo

Pagina 247 - The NVList class

G–8SOMobjects Base Toolkit User’s Guidemethod token A value that identifies a specific method introduced by a class. A method tokenis used during me

Pagina 248 - Building a Request

G–9Glossaryobject request broker (ORB) See ORB.offset method resolutionThe default mechanism for performing method resolution in SOM, because itis

Pagina 249 - Example code

G–10SOMobjects Base Toolkit User’s Guideprocedure A small section of code that executes a limited, well-understood task whencalled from another progra

Pagina 250

G–11Glossaryserver object In DSOM, every server has an object that defines methods for managingobjects in that server. These methods include object

Pagina 251

G–12SOMobjects Base Toolkit User’s GuidesomThis Within method procedures, a local variable that points to a data structurecontaining the instance vari

Pagina 252

X-1IndexAabstract modifier, 4-18activate_impl_failed method, 6-33Activation policies, DSOM servers, 6-64add_arg method, 6-73add_class_to_impldef metho

Pagina 253 - Sockets class

X-2SOMobjects base Toolkit User’s Guidememory management, 6-26method invocation, 6-25failure, 6-80object lifecycle service, 6-17, 6-63object reference

Pagina 254 - Troubleshooting hints

X-3IndexSOM object adapter (SOMOA class), 6-31,6-32, 6-42, 6-62, 6-65‘somdchk’ program, 6-56troubleshooting hints, 6-78tutorial example, 6-5user-suppl

Pagina 255

X-4SOMobjects base Toolkit User’s Guideevent typesclient events, 9-2sink events, 9-2timer events, 9-2work procedure events, 9-2‘eventmsk.h’ include fi

Pagina 256

X-5Indexparent-method calls in, 5-20somSelf usage, 5-18somThis usage, 5-19syntax of SOM Compiler output, 5-17syntax of stub procedures for initializer

Pagina 257

2-9Tutorial for Implementing SOM Classes4) Create a client program that uses the class.Write a program “main” that creates an instance (object) of th

Pagina 258 - 6.11 Limitations

X-6SOMobjects base Toolkit User’s GuideMemory management customization features, 5-46SOMCalloc global variable, 5-46SOMFree global variable, 5-46SOMMa

Pagina 259

X-7Indexmigrate, 4-22namelookup, 4-24nocall, 4-22noenv, 4-22nonstatic, 4-22nooverride, 4-22noself, 4-22object_owns_parameters, 4-23, 6-27, 6-28object_

Pagina 260 - 7.1 Introduction

X-8SOMobjects base Toolkit User’s GuideQualified names for a naming scope, 4-28R‘raises’ expression in method declarations, 4-15Receiving object, 3-8R

Pagina 261

X-9Indexparent class vs metaclass, 5-5primitive SOM class objects, 5-2using with DSOM, 6-42SOM classes, customizing loading/unloading, 5-47class initi

Pagina 262 - The SOM IR file “som.ir”

X-10SOMobjects base Toolkit User’s Guidenon-default initializer calls, 5-30somDefaultInit method, 5-25, 5-38somDestruct method, 5-31somFree method, 5-

Pagina 263

X-11IndexSOMFree function, 3-33, 5-46use after SOMMalloc function, 3-5, 3-7, 5-46SOMFree global variable, 5-46somFree methodcalled by somDestruct meth

Pagina 264

X-12SOMobjects base Toolkit User’s GuideTutorial for implementing SOM classes, 2-6attribute definition, 2-13attributes vs instance variables, 2-14<

Pagina 265

Vos remarques sur ce document / Technical publication remark formTitre / Title :Bull DPX/20 SOMobject Base Toolkit User’s Guide Nº Reférence / Refere

Pagina 268

2-10SOMobjects Base Toolkit User’s GuideNotice that the only argument passed to the “sayHello” method by a C++ client program is theEnvironment pointe

Pagina 269

BULL S.A. CEDOCAtelier de ReproductionFRAN–231331 Avenue Patton BP 42849005 ANGERS CEDEXFRANCE86 A2 27AQ 01ORDER REFERENCEPLACE BAR CODE IN LOWERLEFT

Pagina 270

Utiliser les marques de découpe pour obtenir les étiquettes.Use the cut marks to get the labels.AIX86 A2 27AQ 01SOMobject BaseToolkitUser’s GuideDPX/2

Pagina 271

2-11Tutorial for Implementing SOM Classes case WM_DESTROY: _somFree(obj); PostQuitMessage (0) ; return 0 ; } return DefWindowP

Pagina 272

2-12SOMobjects Base Toolkit User’s GuideFile extensions for SOM filesS IDL source file:.idl for all usersS Implementation template file:.c for C, all

Pagina 273 - TypeCode constants

2-13Tutorial for Implementing SOM ClassesExample 2 — Adding an Attribute to the Hello class Example 1 introduced a class “Hello” which has a method “

Pagina 274 - ++ code that accesses

2-14SOMobjects Base Toolkit User’s Guide4) Update the client program. Modify the client program so that the “_set_msg” method is invoked to initializ

Pagina 275 - Set of Objects

2-15Tutorial for Implementing SOM ClassesAs demonstrated in this example, one disadvantage to using an instance variable is that the“get_msg” and “set

Pagina 276

The following copyright notice protects this book under the Copyright laws of the United States and othercountries which prohibit such actions as, but

Pagina 277 - A hierarchy of metaclasses

2-16SOMobjects Base Toolkit User’s GuideExample 3 — Overriding an Inherited Method An important aspect of OOP programming is the ability of a subclas

Pagina 278

2-17Tutorial for Implementing SOM Classes2) Re-run the SOM Compiler on the updated .idl file, as before. The SOM Compiler extends theexisting implemen

Pagina 279 - Example for composition of

2-18SOMobjects Base Toolkit User’s Guide4) Update the client program to illustrate the change (also notice the new message text):For C programmers:#in

Pagina 280

2-19Tutorial for Implementing SOM ClassesExample 4 — Initializing a SOM Object The previous example showed how to override the method somPrintSelf, i

Pagina 281 - The Metaclass Framework

2-20SOMobjects Base Toolkit User’s Guide3) Customize the implementation. Here, the “msg” instance variable is set in the implementation template (r

Pagina 282

2-21Tutorial for Implementing SOM ClassesExample 5 — Using Multiple Inheritance The “Hello” class is useful for writing messages to the screen. So th

Pagina 283

2-22SOMobjects Base Toolkit User’s Guide(that is, in “hello.h” or “hello.xh”). Declarations that appear outside of an interface body do notappear in t

Pagina 284 - 8.4 Error Codes

2-23Tutorial for Implementing SOM ClassesThe “switch” statement invokes the appropriate method depending on the value of the “output”attribute. Notice

Pagina 285

2-24SOMobjects Base Toolkit User’s Guide

Pagina 286 - Event types

3-1Using SOM Classes in Client ProgramsChapter 3. Using SOM Classes in Client Programs This chapter discusses how to use SOM classes that have alrea

Pagina 287 - Registration

iiiPrefaceAbout This BookThis book accompanies the SOMobjects Base Toolkit, which consists of the base (orcore) capabilities in the System Object Mode

Pagina 288 - Registering for events

3-2SOMobjects Base Toolkit User’s Guide3.1 An Example Client Program Following is a C program that uses the class “Hello” (as defined in the Tutoria

Pagina 289 - Processing events

3-3Using SOM Classes in Client Programs3.2 Using SOM Classes — the BasicsThis section describes the basic information needed to use SOM classes in

Pagina 290 - Interactive applications

3-4SOMobjects Base Toolkit User’s GuideCreating instances of a class For C programmers with usage bindings, SOM provides the <className>New and

Pagina 291 - Extending EMan

3-5Using SOM Classes in Client ProgramsFor example, the following C code uses the function HelloNewClass to create the “Hello” classobject. The argume

Pagina 292 - Tips on using EMan

3-6SOMobjects Base Toolkit User’s GuideFor C++ programmers with usage bindings, instances of a class <className> can becreated with a new operat

Pagina 293 - 9.3 Limitations

3-7Using SOM Classes in Client ProgramsThe somRenew method invoked on the class object creates a new instance of a class using thegiven space, rather

Pagina 294

3-8SOMobjects Base Toolkit User’s Guide(that is, an underscore followed by the method name). Arguments to the macro are the receiverof the method foll

Pagina 295 - SOMobjects Error Codes

3-9Using SOM Classes in Client ProgramsFor example, method “foo” supported by class “Bar” can be invoked as:Bar_foo(obj, somGetGlobalEnvironment(), x,

Pagina 296 - SOM Kernel Error Codes

3-10SOMobjects Base Toolkit User’s GuideFor non-C/C++ programmers: To invoke a static method (that is, a method declared whendefining an OIDL or IDL

Pagina 297 - DSOM Error Codes

3-11Using SOM Classes in Client ProgramsIf the programmer does not know at compile time which class introduces the method to beinvoked, or if the prog

Pagina 298

ivSOMobjects Base Toolkit User’s Guide• The appendices describe customer support-procedures and error codes, and provide thegrammar for SOM IDL. The f

Pagina 299

3-12SOMobjects Base Toolkit User’s GuideFor C++:aVector–>setMany(somGetGlobalEnvironment(), 2, 4, 20, 12, 32, 41);C programmers must be aware that

Pagina 300

3-13Using SOM Classes in Client ProgramsName-lookup resolution is also used to invoke dynamic methods (that is, methods that havebeen added to a class

Pagina 301 - SOM IDL Language Grammar

3-14SOMobjects Base Toolkit User’s GuideSOM method procedures on OS/2 must be called with “system” linkage. On Windows, methodprocedures use the C lin

Pagina 302 - , declarator}*

3-15Using SOM Classes in Client ProgramsDenotes “is a subclass of” classXSOMObjectclassY Following is a C++ generic procedure that uses name-lookup me

Pagina 303

3-16SOMobjects Base Toolkit User’s Guide#include <classX.xh> // use classX’s name–lookup support// this procedure can be invoked on a target of

Pagina 304 - _identifier

3-17Using SOM Classes in Client ProgramsObtaining a pointer to a method’s procedure is achieved in one of two ways, depending onwhether the method is

Pagina 305 - Sockets IDL interface

3-18SOMobjects Base Toolkit User’s GuideSOM_Resolve and SOM_ResolveNoCheck can only be used to obtain method proceduresfor static methods (methods th

Pagina 306

3-19Using SOM Classes in Client ProgramsThe somGetClass method can be overridden by a class to provide enhanced or alternativesemantics for its object

Pagina 307

3-20SOMobjects Base Toolkit User’s GuideWhen using SOM bindings for a class, these bindings define constants representing the majorand minor version n

Pagina 308

3-21Using SOM Classes in Client ProgramsThe somFindClass method uses somLocateClassFile to get the name of the library filecontaining the class. If th

Pagina 309 - IDL for a Sockets subclass

vPrefaceContentsChapter 1. Introduction to the SOMobjects Toolkit 1-1. . . . . . . . . . . . . . . . . . . . . . . . 1.1 Background 1-2. . . . . . .

Pagina 310

3-22SOMobjects Base Toolkit User’s GuideIf the class is not packaged as a library (that is, the client program has the implementationsource code for t

Pagina 311

3-23Using SOM Classes in Client Programs3.3 Language-neutral Methods and Functions This section describes methods, functions, and macros that client

Pagina 312 - IPX/SPX or the

3-24SOMobjects Base Toolkit User’s GuidesomDescendedFrom — Tests whether one class is derived from another. The re-ceiver of the method is the class t

Pagina 313 - Glossary

3-25Using SOM Classes in Client ProgramssomSupportsMethod — Indicates whether instances of a given class support agiven method. The receiver of the so

Pagina 314

3-26SOMobjects Base Toolkit User’s GuideDebugging The following macros are used to conditionally generate output for debugging. All outputgenerated

Pagina 315 - CORBA standards

3-27Using SOM Classes in Client ProgramsSOM_Expect — The SOM_Expect macro takes as an argument a booleanexpression. If the boolean expression is FALS

Pagina 316

3-28SOMobjects Base Toolkit User’s GuideWhen errors are encountered in client programs or user defined-classes, the following twomacros can be used to

Pagina 317

3-29Using SOM Classes in Client ProgramsWhen an exception is detected, the “checkFlag” method must call SOMMalloc to allocate a“BAD_FLAG” structure, i

Pagina 318

3-30SOMobjects Base Toolkit User’s GuideSetting an exception value To set an exception value in the caller’s Environment structure, a method implem

Pagina 319

3-31Using SOM Classes in Client ProgramsExampleThe following IDL interface for a “MyObject” object (in a file called “myobject.idl”) declares a“BAD_FL

Pagina 320 - CORBA is

viSOMobjects Base Toolkit User’s GuideObtaining a method’s procedure pointer 3-16. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Offse

Pagina 321

3-32SOMobjects Base Toolkit User’s Guide/* error checking procedure */boolean ErrorCheck(Environment *ev){ switch (ev._major) { case SYSTEM_EXCE

Pagina 322

3-33Using SOM Classes in Client ProgramsThe implementation of the “checkFlag” method might contain the following error-handling code:#include ”som.h”#

Pagina 323 - TCP/IP sock

3-34SOMobjects Base Toolkit User’s GuideClearing memory for the EnvironmentAny memory associated with an exception in an Environment structure is typi

Pagina 324

3-35Using SOM Classes in Client ProgramssomTotalRegIds — Finds the total number of somIds that have been regis-tered, as an unsigned long. This func

Pagina 325

3-36SOMobjects Base Toolkit User’s Guide

Pagina 326

4-1SOM IDL and the SOM CompilerChapter 4. SOM IDL and the SOM CompilerThis chapter first discusses how to define SOM classes and then describes the S

Pagina 327

4-2SOMobjects Base Toolkit User’s Guide4.1 Interface vs Implementation The interface to a class of objects contains the information that a client m

Pagina 328

4-3SOM IDL and the SOM Compiler4.2 SOM Interface Definition Language This section describes the syntax of SOM’s Interface Definition Language (SOM I

Pagina 329

4-4SOMobjects Base Toolkit User’s GuideTable 1. KEYWORDS FOR SOM IDLanyattributebooleancasecharclassconstcontextdefaultdoubleenumexceptionFALSEfloati

Pagina 330

4-5SOM IDL and the SOM CompilerCharacter type IDL supports a char type, which represents an 8-bit quantity. The ISO Latin-1 (8859.1) charac-ter set d

Pagina 331

viiPrefaceMethod (operation) declarations 4-14. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Oneway keyword 4-14. .

Pagina 332

4-6SOMobjects Base Toolkit User’s GuideThe valid IDL struct and enum definitions shown above are translated by the SOM Compilerinto the following defi

Pagina 333

4-7SOM IDL and the SOM CompilerIn the SOM documentation and samples, both long and short forms are illustrated, for both typenames and method calls. I

Pagina 334

4-8SOMobjects Base Toolkit User’s GuideTemplate types (sequences and strings) IDL defines two template types not found in C and C++: sequences and st

Pagina 335

4-9SOM IDL and the SOM CompilerIf the typedef is for a pointer type, then the effective type is the name of the pointer type. Forexample, the followin

Pagina 336

4-10SOMobjects Base Toolkit User’s GuideHowever, in a C++ program, the following declaration is required:Foo *myobj;If a C programmer uses the SOM Com

Pagina 337 - ADRESSE / ADDRESS :

4-11SOM IDL and the SOM CompilerThus, the ex_BAD_FLAG symbol can be used as a shorthand for naming the exception.An exception declaration within an in

Pagina 338

4-12SOMobjects Base Toolkit User’s GuideTable 2. STANDARD EXCEPTIONS DEFINED BY CORBA module StExcep {#define ex_body { unsigned long minor; complet

Pagina 339

4-13SOM IDL and the SOM CompilerConstant, type, and exception declarations The form of a constant, type, or exception declaration within the body of

Pagina 340 - ORDER REFERENCE

4-14SOMobjects Base Toolkit User’s GuideNote: Although the preceding attribute declarations are equivalent to the explicit methoddeclarations above, t

Pagina 341

4-15SOM IDL and the SOM CompilerClasses derived from SOMObject can declare methods that take a pointer to a block ofmemory containing a variable numbe

Comentarios a estos manuales

Sin comentarios