J
joegen
Hi,
I am working on an o project that involves Lazy Parsing. To be more
specific, Its a SIP Message class that implements zero copy and lazy
parsing. Below is a sample function that is causing me problems.
Since my object is a lazy parser, it needs to evaluate the object to be
parsed during the time an accessor is called.
BOOL SIPMessage::GetAuthorization(
Authorization & h
)
{
if( !ParseAuthorization() )
return FALSE;
if( !HasAuthorization() )
return FALSE;
h = *m_Authorization;
return TRUE;
}
Since this function is performing a none const action
"ParseAuthorization()", I cannot declare this function as constant
which will eventually lead to making my object a perpetually none
constant object. Is there anyway to break this curse? I know I
could "mutate" my member objects ( probably a hundred of them ) but it
gives the shudder. Is there another technique to implement this
cleanly?
Joegen
I am working on an o project that involves Lazy Parsing. To be more
specific, Its a SIP Message class that implements zero copy and lazy
parsing. Below is a sample function that is causing me problems.
Since my object is a lazy parser, it needs to evaluate the object to be
parsed during the time an accessor is called.
BOOL SIPMessage::GetAuthorization(
Authorization & h
)
{
if( !ParseAuthorization() )
return FALSE;
if( !HasAuthorization() )
return FALSE;
h = *m_Authorization;
return TRUE;
}
Since this function is performing a none const action
"ParseAuthorization()", I cannot declare this function as constant
which will eventually lead to making my object a perpetually none
constant object. Is there anyway to break this curse? I know I
could "mutate" my member objects ( probably a hundred of them ) but it
gives the shudder. Is there another technique to implement this
cleanly?
Joegen