INGOR
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ytNode Class Reference

Network node. More...

#include <net/ytNode.h>

Public Member Functions

ytNodeytNode_new ()
 
void ytNode_delete (ytNode *this)
 Deletes the ytNode instance.
 
ytNodeytNode_newName (const char *name)
 
ytObjectytNode_obj (ytNode *this)
 Returns the pointer to this instance as ytObject.
 
ytNodeytNode_from (ytObject *obj)
 Returns the pointer to the ytNode instance from ytObject.
 
ytNodeytNode_clone (const ytNode *this)
 Generates a clone of this ytNode instance.
 
void ytNode_setName (ytNode *this, const char *name)
 Sets the name of this node.
 
const char * ytNode_getName (const ytNode *this)
 Returns the name of this node.
 
void ytNode_setProperty (ytNode *this, const char *key, ytObject *value)
 Adds a property key-value pair.
 
void ytNode_setPropertyInt (ytNode *this, const char *key, int value)
 Adds an integer value property.
 
void ytNode_setPropertyDouble (ytNode *this, const char *key, double value)
 Adds a double precision real value property.
 
void ytNode_setPropertyString (ytNode *this, const char *key, const char *value)
 Adds a string value property.
 
ytObjectytNode_getProperty (const ytNode *this, const char *key)
 Gets a property associated with the given key.
 
ytObjectytNode_getPropertyAt (ytNode *this, size_t i)
 Returns a property value at the specified position.
 
int ytNode_getPropertyInt (ytNode *this, const char *key, int defValue)
 Returns the integer property value.
 
const char * ytNode_getPropertyString (const ytNode *this, const char *key)
 Returns the string property value.
 
size_t ytNode_numProperties (const ytNode *this)
 Returns the number of properties set in this node.
 
ytStrArrayytNode_getPropertyKeys (ytNode *this, ytStrArray *ar)
 Returns all the property keys.
 
const char * ytNode_getPropertyKey (const ytNode *this, size_t i)
 Returns the property key at the specified position.
 
size_t ytNode_size (const ytNode *this)
 Returns the serialized size of the instance.
 
ytByte * ytNode_serialize (const ytNode *this, ytByte **pptr)
 Serializes the ytNode instance.
 
void ytNode_MPI_Bcast (ytNode **node, int root, MPI_Comm comm)
 Broadcasts the ytNode instance with MPI.
 

Public Attributes

ytObject obj
 
char * name
 
ytKeyValuesprop
 

Detailed Description

Network node.

Predefined properties

type (string)
Name of the variable type. The types are defined in ytData.
See also
ytNetwork

Member Function Documentation

◆ ytNode_clone()

ytNode * ytNode_clone ( const ytNode this)

Generates a clone of this ytNode instance.

Parameters
thisytNode instance to clone.
Returns
ytNode instance.

◆ ytNode_from()

ytNode * ytNode_from ( ytObject obj)

Returns the pointer to the ytNode instance from ytObject.

Parameters
obj
Returns
pointer to the ytNode instance.

◆ ytNode_getName()

const char * ytNode_getName ( const ytNode this)

Returns the name of this node.

Do not free the returned pointer.

Parameters
this

◆ ytNode_getPropertyKey()

const char * ytNode_getPropertyKey ( const ytNode this,
size_t  i 
)

Returns the property key at the specified position.

See also
ytNode_numProperties()

◆ ytNode_getPropertyKeys()

ytStrArray * ytNode_getPropertyKeys ( ytNode this,
ytStrArray ar 
)

Returns all the property keys.

The string values returned in the array must be released by yourself.

Parameters
arNULL acceptable. If so, new instance is allocated and returned.

◆ ytNode_MPI_Bcast()

void ytNode_MPI_Bcast ( ytNode **  node,
int  root,
MPI_Comm  comm 
)

Broadcasts the ytNode instance with MPI.

Parameters
[in,out]nodepointer of pointer to the ytNode instance. For the root rank, it specifies the instance to send. Otherwise, it specifies the pointer to receive it.
rootroot rank in the communicator to broadcast. Other ranks receive the broadcasted instance from the root rank.
commMPI communicatior.

◆ ytNode_newName()

ytNode * ytNode_newName ( const char *  name)
Parameters
name

◆ ytNode_obj()

ytObject * ytNode_obj ( ytNode this)

Returns the pointer to this instance as ytObject.

Parameters
this
Returns
pointer to the ytObject instance of this instance.

◆ ytNode_setName()

void ytNode_setName ( ytNode this,
const char *  name 
)

Sets the name of this node.

The given string is copied and is set as the name of this ytNode instance. If the name is already set, it is freed.

Parameters
this
name

The documentation for this class was generated from the following files: