MOD_Aware

MOD_Aware

wba

1998 12-05


CLASS

MOD_Aware - C++ class to make a module aware of WBAs environment processing


SYNOPSIS

MOD_Aware provides a convenient mechanism with which to enable particular Coral libraries to have their logging functionality enabled. There is actually a _Aware class for each module in Coral (for example, GPL_Aware) except OSD (which is not C++). The constructor sets up the WBA_Environment to check for that modules MOD_LOG_LVL while the destructor sets up WBA_Logger. To enable the logging for a particular module simply have the corresponding _Aware object exist in a surrounding scope.


For example a simple program main may look like:


int main(const int argc, const char **argv, const char **envp)
{
	MY_DnaApp my_dna_app;

	// Environment loading scope
	{
		GPL_Aware gplAware;
		WBA_Aware wbaAware;
		DNA_Aware dnaAware;

		// Load only relevant environment variables.
		WBA_ENV.LoadEnvVariables(envp, FALSE);

		// Load everything from command line
		if(!WBA_ENV.LoadCommandLine(argc, argv, TRUE))
		{
			my_dna_app.Printf("%s", my_dna_app.GetUsage());
			my_dna_app.Exit();
		}
	}

	return my_dna_app.Main();
}