-
July 8th, 2017, 05:14 AM
#1
events based on a database(s) result
Hi
I am a beginner attempting to transform to an intermediate C++ coder. I am looking for some ideas with regard to a homework task.
The requirement is :
- 3 different vendor databases (Oracle 11g, SQL Anywhere 17 and PostgreSQL 9.6), all have the same schema and data.
- I am using SQLAPI++ to execute selects, updates, inserts & deletes (DML only!).
- The responses from each DB are stored in a hash table (unordered_map), the key is the hash of the client and SQL statement and the value is a tuple of size three, which holds a struc
- In the case of SELECT's a hash value(md5), instead of the full result set.
- A class, Comparator, then compares the result.
- The Comparator should start comparing when at least 2 results have been returned
- if the 3rd result is present in the unordered_map, then if the comparison from the previous step is successful, the comparison to the 3rd result should proceed
- the client is informed is result is positive or negative
Summary of events:
1. 2 results are present in the tuple (within the unordered_map)
2. a third result has arrived
3. the result comparison is positive
4. the client is informed
I have implemented a Boost.asio TCP/IP server to communicate to clients, but I would like to implement something different for the above summary of events,
which forms a separate layer in the middleware.
These are some of the options that I have read about thus far:
- Boost.signals2
- thread safe Observer Pattern
- CAF_C++ Actor Framework
I am unsure which is more appropriate and (for a beginner) the simplest to implement.
Any suggestions on which I should focus on?
-
July 8th, 2017, 12:53 PM
#2
Re: events based on a database(s) result
I don't know either, but I would recommended trying the sample code from each of the 3. That should help you decide which approach is best for you.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|