ds_aim 241 Posted November 7, 2015 Share Posted November 7, 2015 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) I just taked a look at AsyncSQL.H dunno. The formatting certainly isn't. Also, abusing stdafx out-of-tree. Ugh. And OS-specific synch. Reserved identifiers. C-style structs. Mixing tabs and spaces. DWORD. Fucking m_sem not even used. Copying full async resultset into a container eagerly? Oh. And using mySql Storing SQLResult* in a vector, not honouring Rule Of Three. The fucking type not even polymorphic, so use vector, or stable_vector if you must. Not typedeffing the container or using auto for the iterators. Using strange names for iterators (past?). Nohting ever initializes m_pkSQL. So that's encapsulation disavowed then. What happened to smart pointers... uiResultsPos in the database layer?!?!##!@# Not using prepared statements and bound arguments. C-style error handling through multiple non-encapsulated field. Read: missing errorhandling. CAsyncSQL2 - naming fail. CAsyncSQL looks somewhat saner. Possibly because it was nicked from somewhere? :))) Nice explain , here you have an improved async sql. IMPROVED Soon other libs re 2 7 Link to comment Share on other sites More sharing options...
thalooka 3 Posted November 18, 2015 Share Posted November 18, 2015 Thanks i gona try that Line 59 return vec_pkResult.at(uiResultPos]; should be return vec_pkResult.at(uiResultPos); n with this i dont get errors #ifndef __WIN32__ pthread_t m_hThread; pthread_mutex_t * m_mtxQuery; pthread_mutex_t * m_mtxResult; #else HANDLE m_hThread; CRITICAL_SECTION* m_mtxQuery; CRITICAL_SECTION* m_mtxResult; #endif Can u Post your AsyncSql.cpp aswell? Otherwise m_sem needs to be included again for noobs like me Link to comment Share on other sites More sharing options...
ds_aim 241 Posted November 18, 2015 Author Share Posted November 18, 2015 42 minutes ago, thalooka said: Thanks i gona try that Line 59 return vec_pkResult.at(uiResultPos]; should be return vec_pkResult.at(uiResultPos); n with this i dont get errors #ifndef __WIN32__ pthread_t m_hThread; pthread_mutex_t * m_mtxQuery; pthread_mutex_t * m_mtxResult; #else HANDLE m_hThread; CRITICAL_SECTION* m_mtxQuery; CRITICAL_SECTION* m_mtxResult; #endif Can u Post your AsyncSql.cpp aswell? Otherwise m_sem needs to be included again for noobs like me I will post if u want. But you need c++1z to use. Link to comment Share on other sites More sharing options...
thalooka 3 Posted November 18, 2015 Share Posted November 18, 2015 got c++14 flag atm so should be fine :) Link to comment Share on other sites More sharing options...
ds_aim 241 Posted January 4, 2016 Author Share Posted January 4, 2016 Sorry , here is. Directly from my source. :P AsyncSQL.cpp - C++14- Google Format coding AsyncSQL.h - C++14 - Google Format coding On 18.11.2015 at 2:04 PM, thalooka said: got c++14 flag atm so should be fine :) 1 Link to comment Share on other sites More sharing options...
miguelmig 13 Posted January 5, 2016 Share Posted January 5, 2016 What features did you use that require C++14? Link to comment Share on other sites More sharing options...
scrabbyyy 20 Posted January 5, 2016 Share Posted January 5, 2016 On 07.11.2015 at 5:33 PM, ds_aim said: I just taked a look at AsyncSQL.H dunno. The formatting certainly isn't. Also, abusing stdafx out-of-tree. Ugh. And OS-specific synch. Reserved identifiers. C-style structs. Mixing tabs and spaces. DWORD. Fucking m_sem not even used. Copying full async resultset into a container eagerly? Oh. And using mySql Storing SQLResult* in a vector, not honouring Rule Of Three. The fucking type not even polymorphic, so use vector, or stable_vector if you must. Not typedeffing the container or using auto for the iterators. Using strange names for iterators (past?). Nohting ever initializes m_pkSQL. So that's encapsulation disavowed then. What happened to smart pointers... uiResultsPos in the database layer?!?!##!@# Not using prepared statements and bound arguments. C-style error handling through multiple non-encapsulated field. Read: missing errorhandling. CAsyncSQL2 - naming fail. CAsyncSQL looks somewhat saner. Possibly because it was nicked from somewhere? :))) Nice explain , here you have an improved async sql. IMPROVED Soon other libs re what happening with that? so need easy and short explain Link to comment Share on other sites More sharing options...
ds_aim 241 Posted January 5, 2016 Author Share Posted January 5, 2016 1 hour ago, miguelmig said: What features did you use that require C++14? auto . nullptr google style In those files i used just two c++14 features. But in my source it's more. Link to comment Share on other sites More sharing options...
Unc3nZureD 59 Posted January 6, 2016 Share Posted January 6, 2016 1 hour ago, ds_aim said: auto . nullptr In those files i used just two c++14 features. (Just a side note: both nullptr and auto is a C++11 feature ) C++14 mostly IMPROVED the capability of auto. I mean, from now you can use auto as the return value of a function (only if it's obvious). Even there were some improvements with auto & lambda function connection, so now it's easier to use. And not to mention a quite interesting thing: [[deprecated]]. Have a look at it It's quite nice when it comes to a bigger project management, not only a small home-made Another awesome feature of C++14 is that now you can initialize an int (or anything else) in binary format! Just like you create a hex 0xFFAA. now you can make 0b0011100110 But as far as I can see it's enough to have C++11 to compile that code (No offense) Please tell me if I'm wrong (P.s.: It's a really nice, clean & easily readable code!) 1 Link to comment Share on other sites More sharing options...
Abigo 7 Posted March 27, 2016 Share Posted March 27, 2016 thanks i will use. Link to comment Share on other sites More sharing options...
Recommended Posts