Thank you so much for your reply. FYI, there is no db involved, as at the time of making the script all the objects are already available in the memory. I just need to traverse them one by one, make the script out of it. Keeping in mind there would be rules to make the script, I wish I could do it in a cleaner way ( avoiding lot of if and else while making the text for the script)
FrankStar89
Posts
-
Script generation from Objects using C++ -
Script generation from Objects using C++Thank you for your advice. Sure it is part of the solution. I was looking more on making the script file ( that is the text of the scripts), as in how should I do that. Shall I simply make a hard-coded string with lot of if and else ( from the objects), and append them one by one, or do we have a fit design Pattern for this. Keeping in mind there would be some rules for the script generation, I would love to make it cleaner with some well design structure.
-
Script generation from Objects using C++Hello friends, I needed some hints/suggestion/brainstorm, so to go in a right direction. I have lot of different Objects, based on which I need to generate a Text-file. This text is nothing but a Scripting Language with some specific rules or grammars. ( Example, like a VB script ). A simple/legacy way could be, Iterate all the objects, and Append hard-coded text ( to a global string), with many if and else cases. Now, I am looking if any framework/design/principle is available, or I can make use of it, to make a clean design/code instead writing lot of if and else. One I found is boost karma, but looking for alternatives to make the best choice. Seeking your valuable advises. Thanks in advance,
-
Set whole Data to a struct with BitFieldsHi all, I need to define a structure (its some spec frame-structure), so that I can assign data and retrieve-fields easily. So my definition is like below
struct MyDef
{
DWORD B1 : 8;
DWORD B2 : 8;
DWORD B3 : 8;
DWORD B4 : 8;
};(Note that, the whole struct contains 32 bits.) Now, I need a way to set some DWORD value to it directly. something like this
MyDef Def;
Def.data = 0xAABBCCDD;//This is the requirement. The 'data' needs to be defined in MyDef in such a way that this gets splits to the fields already defined(please note that, I need to keep the bit-fields so that I can set the fields as well.) Please help me.
-
Real time drawing using multithreadingThanks David, That would surely be helpful.
-
Real time drawing using multithreadingThanks Jschell. I am not sure yet how many points per sec. ( still in the initial stage.) I think there would be data munging for sure. Anyway, what I was looking here mostly any "usual Design Pattern" for this kind of problem in general. (1 thread is reading and another is drawing simultaneously). Thanks again.
-
Real time drawing using multithreadingHello there, I am looking for the best Way/Strategy to "Continuously read data from the HW in real-time and draw some GUI-diagram in Parallel". Performance would be a big matter here since the graph has to be drawn in real-time. Its just coming to my mind about 1) creating 1 worker-thread for reading process, and 2) another for GUI drawing. But I am looking for perfection and suggestions here. 1) Is there any specific Design-Pattern that would fit this?. If so, please suggest. 2) Whats the best way(container) to read data by the worker-thread and keep it for the GUI-thread to process. FIFO? or some other class? Thanks in advance for your suggestion and advice.