Smart CODE
Your on-line guide to the generated code

NAME
ConditionsProc - Pre and Post Conditions in the client managing connection to the server.

INTRODUCTION
A thin-client doesn't process the data, but passes it through to a server. However, it may want to validate the data before it sends it on, and cancel the transaction if the user hasn't filled out the fields appropriately. This is done through the preconditions function. Also, the client may want to examine the data that is returned from the server before allowing the interface to be updated. This is done with postconditions.

The generated code includes nominal precondition and postcondition functions that both return true (non-zero). You can write any checks you need in these stubs, and use the group data object to access and modify the data in the group.

In the preconditions function, the group data object reflects the state of the interface. In the postconditions function it reflects the new state, as sent from the server. The interface is only updated after the postcondition function has been called.

SYNOPSIS

C

typedef int (*PreconditionsProc)( AnyGroup_t*)
	AnyGroup_t * group;


/* example */ int CALLBACKNAME_preconditions ( group) AnyGroup_t* group; { return 1; /* write checks here */ } typedef int (*PostconditionsProc)( AnyGroup_t*) AnyGroup_t * group;

/* example */ int aaa_postconditions ( group) AnyGroup_t* group; { return 1; /* write checks here */ }

C++

class METHODNAME_cs: public sc_stdcs_c
{
	int preconditions()  { return 1; }
	int postconditions() { return 1; }
};

sc_stdcs_c *
getNew_METHODNAME()
{
	return (sc_stdcs_c*) new METHODNAME_cs;
}
Java

public class METHODNAME_cs extends SCStdCS
{
	public boolean preconditions()
	{
		return true;
	}

	public boolean postconditions()
	{
		return true;
	}

	public static METHODNAME_cs getNew()
	{
		return  new METHODNAME_cs();
	}
}

Inputs

Returns
Non-zero in C, C++ for true. In Java, boolean true or false;
Other Notes
CALLBACKNAME and METHODNAME will be replaced in the generated code by the name you have given to your callback or method.

DESCRIPTION

USAGE

EXAMPLES

SEE ALSO