The HUserOptions class is a helper class which wraps up memory management for variable size user options returned from HOOPS. More...

#include <HUtility.h>

Public Member Functions

 HUserOptions ()
 
 HUserOptions (const HUserOptions &in_data)
 
bool IsValid ()
 
const char * Show_Net_User_Options ()
 
const char * Show_One_Net_User_Option (const char *which)
 
const char * Show_One_User_Option (const char *which)
 
const char * Show_User_Options ()
 
 ~HUserOptions ()
 

Public Attributes

char * m_data
 actual char* to the user options
 
int m_length
 length of current user option
 
bool m_valid
 

Detailed Description

The HUserOptions class is a helper class which wraps up memory management for variable size user options returned from HOOPS.

HUserOptions uses Show_User_Option_Length (or variation) to get the length of user option and manages memory allocation and free for Show_User_Option. Following shows an example usage

without HUserOption class: problem is assumption that option is max 1024 char * options[MVO_BUFFER_SIZE]; HC_Show_User_Option(options); if( strstr(options, "true") return true;

with HUserOption class: automatically allocates enough memory required (by using Show_XXX_Length routene) and free the memory in the destructor HUserOptions options; options.Show_User_Option(); if( strstr(options.m_data, "true") return true;

Constructor & Destructor Documentation

◆ HUserOptions() [1/2]

HUserOptions::HUserOptions ( )

constructor

◆ HUserOptions() [2/2]

HUserOptions::HUserOptions ( const HUserOptions in_data)

copy constructor

◆ ~HUserOptions()

HUserOptions::~HUserOptions ( )

destructor

Member Function Documentation

◆ IsValid()

bool HUserOptions::IsValid ( )

IsValid returns true if the user option held in this object is valid i.e. if m_length > 0

◆ Show_Net_User_Options()

const char* HUserOptions::Show_Net_User_Options ( )

Show_Net_User_Options Wraps HC_Show_Net_User_Options to use Show_XXX_Length routene and perform memory management. Please refer to the documentation of HC_Show_Net_User_Options from HOOPS/3dGS reference manual for details

Returns
A char * to the user options string. You can also access the same via HUserOptions.m_data

◆ Show_One_Net_User_Option()

const char* HUserOptions::Show_One_Net_User_Option ( const char *  which)

Show_One_Net_User_Option Wraps HC_Show_One_Net_User_Option to use Show_XXX_Length routene and perform memory management. Please refer to the documentation of HC_Show_One_Net_User_Option from HOOPS/3dGS reference manual for details

Returns
A char * to the user options string. You can also access the same via HUserOptions.m_data

◆ Show_One_User_Option()

const char* HUserOptions::Show_One_User_Option ( const char *  which)

Show_One_User_Option Wraps HC_Show_One_User_Option to use Show_XXX_Length routene and perform memory management. Please refer to the documentation of HC_Show_One_User_Option from HOOPS/3dGS reference manual for details

Returns
A char * to the user options string. You can also access the same via HUserOptions.m_data

◆ Show_User_Options()

const char* HUserOptions::Show_User_Options ( )

Show_User_Options Wraps HC_Show_User_Options to use Show_XXX_Length routene and perform memory management. Please refer to the documentation of HC_Show_User_Options from HOOPS/3dGS reference manual for details

Returns
A char * to the user options string. You can also access the same via HUserOptions.m_data

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