HUserOptions

class HUserOptions

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;

Methods

HUserOptions::HUserOptions()

constructor

HUserOptions::HUserOptions(HUserOptions const &in_data)

copy constructor

HUserOptions::~HUserOptions()

destructor

bool HUserOptions::IsValid() const

const

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

char const *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
char const *HUserOptions::Show_One_Net_User_Option(char const *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
char const *HUserOptions::Show_One_User_Option(char const *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
char const *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
void HUserOptions::clear()

private

Variables

char *HUserOptions::m_data
char

actual char* to the user options

int HUserOptions::m_length
int

length of current user option

bool HUserOptions::m_valid
bool