Skip to content

Commit

Permalink
Use deleted ctors in sockets.
Browse files Browse the repository at this point in the history
  • Loading branch information
wilx committed Dec 7, 2024
1 parent e74cc5e commit f9ccc39
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
5 changes: 2 additions & 3 deletions include/log4cplus/helpers/socketbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class LOG4CPLUS_EXPORT SocketBuffer
{
public:
explicit SocketBuffer(std::size_t max);
SocketBuffer(SocketBuffer const & rhs) = delete;
SocketBuffer& operator= (SocketBuffer const& rhs) = delete;
virtual ~SocketBuffer();

char *getBuffer() const { return buffer; }
Expand All @@ -68,9 +70,6 @@ class LOG4CPLUS_EXPORT SocketBuffer
std::size_t size;
std::size_t pos;
char *buffer;

SocketBuffer(SocketBuffer const & rhs);
SocketBuffer& operator= (SocketBuffer const& rhs);
};

} // end namespace helpers
Expand Down
8 changes: 3 additions & 5 deletions include/log4cplus/socketappender.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ namespace log4cplus
const log4cplus::tstring& serverName = tstring(),
bool ipv6 = false);
SocketAppender(const log4cplus::helpers::Properties & properties);
// Disallow copying of instances of this class
SocketAppender(const SocketAppender&) = delete;
SocketAppender& operator=(const SocketAppender&) = delete;

// Dtor
~SocketAppender();
Expand Down Expand Up @@ -142,11 +145,6 @@ namespace log4cplus
volatile bool connected;
helpers::SharedObjectPtr<helpers::ConnectorThread> connector;
#endif

private:
// Disallow copying of instances of this class
SocketAppender(const SocketAppender&);
SocketAppender& operator=(const SocketAppender&);
};

namespace helpers {
Expand Down
7 changes: 3 additions & 4 deletions include/log4cplus/syslogappender.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ namespace log4cplus
int port = 514, const tstring & facility = tstring (),
RemoteSyslogType remoteSyslogType = RSTUdp, bool ipv6 = false, bool fqdn = true);
SysLogAppender(const log4cplus::helpers::Properties & properties);
// Disallow copying of instances of this class
SysLogAppender(const SysLogAppender&) = delete;
SysLogAppender& operator=(const SysLogAppender&) = delete;

// Dtor
virtual ~SysLogAppender();
Expand Down Expand Up @@ -150,10 +153,6 @@ namespace log4cplus
#endif

private:
// Disallow copying of instances of this class
SysLogAppender(const SysLogAppender&);
SysLogAppender& operator=(const SysLogAppender&);

std::string identStr;
tstring hostname;
};
Expand Down

0 comments on commit f9ccc39

Please sign in to comment.