Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

Estado
subtletrue
colourGreen
titletlpp - language

Composition Setup
import.css=/download/attachments/327912/newLayout.css
Portuguese
Section

Abrangência
Versão 17.3.0.0 e superiores

Section
A partir da versão 17.3.0.0 será possível obter o retorno dos métodos e atributos de uma classe sem instanciá-la.




Bloco de código
languagecpp
firstline1
titleInterface.tlpp
linenumberstrue
#include "

...

tlpp-object.

...

th"
 

...

Class TesteReflection
  public method new()
 

...

 protected method 

...

func1()
  

...

private method 

...

func2()
  public data data1
 

...

 private data data2
  

...

protected data data3

...

EndClass
 

...

 
method new() class TesteReflection

...

Return self

...


method 

...

func1() class TesteReflection

...

Return self

...

method 

...

func2() class TesteReflection

...

Return self

Function u_test_getClass

...

 

...

 

...

local 

...

retMethods := TesteReflection():TGetMethods()

...

  local retData := TesteReflection():TGetData()

...

  conout("### methods:")

...

  conout(retMethods[1])

...

  conout(retMethods[2])

...

  conout(retMethods[3])

...

  conout("### data:")

...

  conout(retData[1])

...

  conout(retData[2])

...

  conout(retData[3])

...

Return

Resultado:

### methods:
FUNC1
FUNC2
NEW
### data:
DATA1
DATA2
DATA3