mirror of
https://github.com/debauchee/barrier.git
synced 2026-12-01 00:05:10 +08:00
Indentation changes.
This commit is contained in:
@@ -26,7 +26,7 @@ typedef int ssize_t;
|
||||
// FIXME -- must handle htonl and ilk when defined as macros
|
||||
|
||||
class CNetwork {
|
||||
public:
|
||||
public:
|
||||
#if defined(CONFIG_PLATFORM_WIN32)
|
||||
typedef SOCKET Socket;
|
||||
typedef struct sockaddr Address;
|
||||
@@ -129,7 +129,7 @@ class CNetwork {
|
||||
static int (PASCAL FAR *gethosterror)(void);
|
||||
|
||||
#if defined(CONFIG_PLATFORM_WIN32)
|
||||
private:
|
||||
private:
|
||||
static void init2(HMODULE);
|
||||
static int PASCAL FAR poll2(PollEntry[], int nfds, int timeout);
|
||||
static ssize_t PASCAL FAR read2(Socket s, void FAR * buf, size_t len);
|
||||
|
||||
@@ -24,15 +24,15 @@ CNetworkAddress::CNetworkAddress(const CString& hostname, UInt16 port)
|
||||
struct hostent* hent = CNetwork::gethostbyname(hostname.c_str());
|
||||
if (hent == NULL) {
|
||||
switch (CNetwork::gethosterror()) {
|
||||
case CNetwork::kHOST_NOT_FOUND:
|
||||
case CNetwork::kHOST_NOT_FOUND:
|
||||
throw XSocketAddress(XSocketAddress::kNotFound, hostname, port);
|
||||
|
||||
case CNetwork::kNO_DATA:
|
||||
case CNetwork::kNO_DATA:
|
||||
throw XSocketAddress(XSocketAddress::kNoAddress, hostname, port);
|
||||
|
||||
case CNetwork::kNO_RECOVERY:
|
||||
case CNetwork::kTRY_AGAIN:
|
||||
default:
|
||||
case CNetwork::kNO_RECOVERY:
|
||||
case CNetwork::kTRY_AGAIN:
|
||||
default:
|
||||
throw XSocketAddress(XSocketAddress::kUnknown, hostname, port);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
class CString;
|
||||
|
||||
class CNetworkAddress {
|
||||
public:
|
||||
public:
|
||||
CNetworkAddress(UInt16 port);
|
||||
CNetworkAddress(const CString& hostname, UInt16 port);
|
||||
~CNetworkAddress();
|
||||
@@ -20,7 +20,7 @@ class CNetworkAddress {
|
||||
const CNetwork::Address* getAddress() const;
|
||||
CNetwork::AddressLength getAddressLength() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
CNetwork::Address m_address;
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ class CMutex;
|
||||
class IJob;
|
||||
|
||||
class CSocketInputStream : public IInputStream {
|
||||
public:
|
||||
public:
|
||||
CSocketInputStream(CMutex*, IJob* adoptedCloseCB);
|
||||
~CSocketInputStream();
|
||||
|
||||
@@ -30,7 +30,7 @@ class CSocketInputStream : public IInputStream {
|
||||
virtual UInt32 read(void*, UInt32 count);
|
||||
virtual UInt32 getSize() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
CMutex* m_mutex;
|
||||
CCondVar<bool> m_empty;
|
||||
IJob* m_closeCB;
|
||||
|
||||
@@ -8,7 +8,7 @@ class CMutex;
|
||||
class IJob;
|
||||
|
||||
class CSocketOutputStream : public IOutputStream {
|
||||
public:
|
||||
public:
|
||||
CSocketOutputStream(CMutex*, IJob* adoptedCloseCB);
|
||||
~CSocketOutputStream();
|
||||
|
||||
@@ -30,10 +30,10 @@ class CSocketOutputStream : public IOutputStream {
|
||||
virtual UInt32 write(const void*, UInt32 count);
|
||||
virtual void flush();
|
||||
|
||||
private:
|
||||
private:
|
||||
UInt32 getSizeWithLock() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
CMutex* m_mutex;
|
||||
IJob* m_closeCB;
|
||||
CSocketStreamBuffer m_buffer;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <vector>
|
||||
|
||||
class CSocketStreamBuffer {
|
||||
public:
|
||||
public:
|
||||
CSocketStreamBuffer();
|
||||
~CSocketStreamBuffer();
|
||||
|
||||
@@ -25,7 +25,7 @@ class CSocketStreamBuffer {
|
||||
// return the number of bytes in the buffer
|
||||
UInt32 getSize() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
static const UInt32 kChunkSize;
|
||||
|
||||
typedef std::vector<UInt8> Chunk;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "CNetwork.h"
|
||||
|
||||
class CTCPListenSocket : public IListenSocket {
|
||||
public:
|
||||
public:
|
||||
CTCPListenSocket();
|
||||
~CTCPListenSocket();
|
||||
|
||||
@@ -18,7 +18,7 @@ class CTCPListenSocket : public IListenSocket {
|
||||
virtual ISocket* accept();
|
||||
virtual void close();
|
||||
|
||||
private:
|
||||
private:
|
||||
CNetwork::Socket m_fd;
|
||||
};
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class CBufferedInputStream;
|
||||
class CBufferedOutputStream;
|
||||
|
||||
class CTCPSocket : public ISocket {
|
||||
public:
|
||||
public:
|
||||
CTCPSocket();
|
||||
CTCPSocket(CNetwork::Socket);
|
||||
~CTCPSocket();
|
||||
@@ -29,14 +29,14 @@ class CTCPSocket : public ISocket {
|
||||
virtual IInputStream* getInputStream();
|
||||
virtual IOutputStream* getOutputStream();
|
||||
|
||||
private:
|
||||
private:
|
||||
void init();
|
||||
void ioThread(void*);
|
||||
void ioService();
|
||||
void closeInput(void*);
|
||||
void closeOutput(void*);
|
||||
|
||||
private:
|
||||
private:
|
||||
enum { kClosed = 0, kRead = 1, kWrite = 2, kReadWrite = 3 };
|
||||
|
||||
CNetwork::Socket m_fd;
|
||||
|
||||
@@ -9,7 +9,7 @@ class CNetworkAddress;
|
||||
class ISocket;
|
||||
|
||||
class IListenSocket : public IInterface {
|
||||
public:
|
||||
public:
|
||||
// manipulators
|
||||
|
||||
// bind the socket to a particular address
|
||||
|
||||
@@ -11,7 +11,7 @@ class IInputStream;
|
||||
class IOutputStream;
|
||||
|
||||
class ISocket : public IInterface {
|
||||
public:
|
||||
public:
|
||||
// manipulators
|
||||
|
||||
// bind the socket to a particular address
|
||||
|
||||
@@ -8,19 +8,19 @@
|
||||
class XNetwork : public XBase { };
|
||||
|
||||
class XNetworkUnavailable : public XNetwork {
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
};
|
||||
|
||||
class XNetworkFailed : public XNetwork {
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
};
|
||||
|
||||
class XNetworkVersion : public XNetwork {
|
||||
public:
|
||||
public:
|
||||
XNetworkVersion(int major, int minor) throw();
|
||||
|
||||
// accessors
|
||||
@@ -28,24 +28,24 @@ class XNetworkVersion : public XNetwork {
|
||||
int getMajor() const throw();
|
||||
int getMinor() const throw();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
|
||||
private:
|
||||
private:
|
||||
int m_major;
|
||||
int m_minor;
|
||||
};
|
||||
|
||||
class XNetworkFunctionUnavailable : public XNetwork {
|
||||
public:
|
||||
public:
|
||||
XNetworkFunctionUnavailable(const char* name) throw();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
|
||||
private:
|
||||
private:
|
||||
CString m_name;
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
class XSocket : public XBase { };
|
||||
|
||||
class XSocketAddress : public XSocket {
|
||||
public:
|
||||
public:
|
||||
enum Error { kUnknown, kNotFound, kNoAddress, kBadPort };
|
||||
|
||||
XSocketAddress(Error, const CString& hostname, SInt16 port) throw();
|
||||
@@ -19,24 +19,24 @@ class XSocketAddress : public XSocket {
|
||||
virtual CString getHostname() const throw();
|
||||
virtual SInt16 getPort() const throw();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
|
||||
private:
|
||||
private:
|
||||
Error m_error;
|
||||
CString m_hostname;
|
||||
SInt16 m_port;
|
||||
};
|
||||
|
||||
class XSocketErrno : public XSocket, public MXErrno {
|
||||
public:
|
||||
public:
|
||||
XSocketErrno();
|
||||
XSocketErrno(int);
|
||||
};
|
||||
|
||||
class XSocketBind : public XSocketErrno {
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
};
|
||||
@@ -44,13 +44,13 @@ class XSocketBind : public XSocketErrno {
|
||||
class XSocketAddressInUse : public XSocketBind { };
|
||||
|
||||
class XSocketConnect : public XSocketErrno {
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
};
|
||||
|
||||
class XSocketCreate : public XSocketErrno {
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user