The possibilities could be three - do not implement the state at all and let the user define it all the time; - implement the state in a "static" way, like OpenCV; - implement the state using templates, like PCL.