get_object_counter
Tobias Müller, M. Eng edited this page 5 years ago

📜 Table of Contents


get_object_counter

Definition
def get_object_counter():
Description

The "get_object_counter" method is used to check the number of objects. It returns an integer value of the counter. This method can be called with and without a created object.

Arguments

None

Return Value

Type -> integer

Example Code
>>> # call the Method 'get_object_counter'
>>> Obj_Count = Xcom_API.get_object_counter()
>>> 
>>> # print Obj_Count
>>> print(Obj_Count)
    0
>>> 
>>> # create an object of the Xcom-API-Class
>>> Object1 = Xcom_API(destination=102)
>>> 
>>> # call the Method 'get_object_counter'
>>> Obj_Count = Object1.get_object_counter()
>>> 
>>> # print Obj_Count
>>> print(Obj_Count)
    1
>>> 
>>> # create another object of the Xcom-API-Class
>>> Object2 = Xcom_API(destination=103)
>>> 
>>> # call the Method 'get_object_counter'
>>> Obj_Count = Xcom_API.get_object_counter()
>>> 
>>> # print Obj_Count
>>> print(Obj_Count)
    2
>>> 
>>> # delete objects
>>> del Object1
>>> del Object2
>>> 
>>> # call the Method 'get_object_counter'
>>> Obj_Count = Xcom_API.get_object_counter()
>>> 
>>> # print Obj_Count
>>> print(Obj_Count)
    0

Hochschule Anhalt | Anhalt University of Applied Sciences | Department 6 EMW
Xcom-API

Tobias Müller, M. Eng.
📧 Tobias.Mueller@HS-Anhalt.de

© es-lab.de, 31.10.2017