On Jan 9, 5:54*pm, Rahul <sam_...@yahoo.co.inwrote:
>
well, the logic of utility depends on the caller, and moreover utility
wouldn't like to service unknown callers ( as in callers should
register before hand )...- Hide quoted text -
The words "design error" are flashing in big red letters in
my brain ... it doesn't make sense to disqualify callers
who have linked to your library, that's the sort of security
you'd impose on a distributed service, not a function call.
If you still want to impose something like this, then just
have:
typedef <something hereUtilityUseHandle;
// callers must get a handle first ...
// (function concocts a verifyable handle and returns it)
UtilityUseHandle register(<some credentials>);
// utility function - must pass valid handle else
// it'll throw an InvalidUtilityUseHandle exception
<retvaluse_utility_fn(
const UtilityUseHandle& valid_registered_handle,
<other parameters>
) /* throw (InvalidUtilityUseHandle) */ ;
// finished, thank you ...
void unregister(
const UtilityUseHandle& valid_registered_handle
) /* throw (InvalidUtilityUseHandle) */ ;