Bull DPX/20 Guia do Utilizador Página 164

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 424
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 163
1-152 SOMobjects Base Toolkit: Programmers Reference Manual
somPrintSelf Method
Purpose
Outputs a brief description that identifies the receiving object. Designed to be overridden.
IDL Syntax
SOMObject somPrintSelf ( );
Note: For backward compatibility, this method does not take an Environment parameter.
Description
somPrintSelf should output a brief string containing key information useful to identify the
receiver object, rather than a complete dump of the receiver object state as provided by
somDumpSelfInt. The somPrintSelf method should use the character output routine
SOMOutCharRoutine (or any of the somPrintf functions) for this purpose. The default
implementation outputs the name of the receiver object’s class and the receiver’s address in
memory.
Because the most specific identifying information for an object will often be found within
instance data introduced by the class of an object, it is likely that a class implementor that
overrides this method will not need to invoke parent methods in order to provide a useful
string identifying the receiver object.
Parameters
receiver A pointer to the object to be described.
Return Value
The somPrintSelf method returns a pointer to the receiver object as its result.
C Example
#include <animal.h>
main()
{
Animal myAnimal;
myAnimal = AnimalNew ();
/* ... */
_somPrintSelf (myAnimal);
_somFree (myAnimal);
}
/*
Output from this program:
{An instance of class Animal at address 0001CEC0}
*/
Original Class
SOMObject
Related Information
Methods: somDumpSelf, somDumpSelfInt
Vista de página 163
1 2 ... 159 160 161 162 163 164 165 166 167 168 169 ... 423 424

Comentários a estes Manuais

Sem comentários