This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sys/stat.h> | |
#include <sys/sem.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <semaphore.h> | |
#include <errno.h> | |
#include <fcntl.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
template <int length> | |
int foo( const char tab[length] ) | |
{ | |
return sizeof( length ); | |
} | |
template <size_t N> | |
//int bar( const char tab[N] ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
inline bool IsNull( const std::string& v ) { return ( v == "" ); } | |
inline bool IsNull( long v ) { return ( v == 0 ); } | |
inline bool IsNull( char c ) { return ( c == 0 ); } | |
template <typename T> | |
bool IsNotNull(const T & v) { return !IsNull(v); } | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ace/Task.h" | |
#include "ace/Message_Queue.h" | |
#include "ace/Synch_Traits.h" | |
#include "ace/Thread_Mutex.h" | |
#include <cerrno> | |
#include <iostream> | |
int main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ace/Semaphore.h> | |
#include <iostream> | |
int main() | |
{ | |
std::cout << "hello wordl" << std::endl; | |
ACE_Semaphore signal( 0, USYNC_THREAD, "test_ACE_sem" ); | |
signal.dump(); | |
signal.release(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <sstream> | |
// --------------------------------------------------------------------------- | |
std::ostream& operator << ( std::ostream& os, const std::vector<char>& vec ) | |
{ | |
for( std::vector<char>::const_iterator it = vec.begin(); it != vec.end(); ++it ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <sstream> | |
// --------------------------------------------------------------------------- | |
std::ostream& operator << ( std::ostream& os, const std::vector<char>& vec ) | |
{ | |
for( std::vector<char>::const_iterator it = vec.begin(); it != vec.end(); ++it ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ace/Event_Handler.h" | |
#include "ace/SOCK_Stream.h" | |
#include <iostream> | |
class ProducerEventHandler : public ACE_Event_Handler | |
{ | |
public: | |
ACE_SOCK_Stream &peer(void) { return sock_; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <ace/Event_Handler.h> | |
#include <ace/Connector.h> | |
class MySvcHandler : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_MT_SYNCH> | |
{ | |
}; | |
class Session : public ACE_Event_Handler |