|
From: Vladimir S. <ha...@so...> - 2004-06-30 12:32:32
|
Hi Rui, Christian, >>Another thing, probably unrelated, is that OnSetValue() only gets called >>when we set the parameter value as a string, with SetValue(String val) but >>not with SetValue(int i). Is this intentional? >> >> > >Originally, my intention was that the parser just supplies a string for a >parameter value, so the parser does not have to know what type the respective >parameter is (bool, int, string,...), so it would always call >SetValue(String s) which has to be implemented by all Parameter classes and >they implement the conversion from string to their own type >(e.g string -> int) and then they call OnSetValue(<their_type> val) to let the >device driver react on parameter value changes. > > > I think that's cool. We just need a place to initialize parameters and that place should not be in the constructor. Are you OK with me putting it into the factory::create then? Regards, Vladimir. PS: Multiconnection single threaded LSCPServer seems to be working OK (for me). I'm thinking about clearning it up a bit and checking it in some time this week. While i'm at it i'll also add notification support. My current thinking is that perhaps singlethreaded way of doing things is sufficient for control. Notifications will be delivered in "real time" under control of whoever is generating them or (if required) by a separate thread that is responsible for sending notifications. Right now i'm reading a command (line) and dispatching it into the parser, then reading another one, dispatching, etc, etc. Sequentially. Chances are we are not going to be blocked on read in the middle of the command/line. I could add support for that also but that will make the code a bit less clear. |