asycxx-devel Mailing List for Asynchronous C++ Application framework (Page 4)
Status: Alpha
Brought to you by:
joe_steeve
You can subscribe to this list here.
| 2009 |
Jan
|
Feb
(16) |
Mar
(27) |
Apr
(44) |
May
(3) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: <joe...@us...> - 2009-03-12 09:35:29
|
Revision: 6
http://asycxx.svn.sourceforge.net/asycxx/?rev=6&view=rev
Author: joe_steeve
Date: 2009-03-12 09:35:26 +0000 (Thu, 12 Mar 2009)
Log Message:
-----------
split asycxx internal stuff into the private asycxx-common.h
The installed ascyxx.h should not contain things that are internal to
asycxx. Hence moved asycxx specific content into a private
asycxx-common.h. the include/asycxx.h should be used as a one time
header to include all parts of asycxx.
From: Joe Steeve <js...@hi...>
Modified Paths:
--------------
trunk/configure.ac
trunk/include/asycxx/DataBuffer.h
trunk/include/asycxx/Deferred.h
trunk/include/asycxx/Error.h
trunk/include/asycxx/Factory.h
trunk/include/asycxx/GimpleMsgBus.h
trunk/include/asycxx/Listener.h
trunk/include/asycxx/MsgBus.h
trunk/include/asycxx/MsgHandler.h
trunk/include/asycxx/Protocol.h
trunk/include/asycxx/Reactor.h
trunk/include/asycxx/RefCounter.h
trunk/include/asycxx/SelectReactor.h
trunk/include/asycxx/TCPLLTransport.h
trunk/include/asycxx/TCPListener.h
trunk/include/asycxx/TCPTransport.h
trunk/include/asycxx/Timer.h
trunk/include/asycxx/Transport.h
trunk/include/asycxx/XMLParser.h
trunk/include/asycxx/asycxx.h
trunk/src/DataBuffer.cxx
trunk/src/Error.cxx
trunk/src/Factory.cxx
trunk/src/GimpleMsgBus.cxx
trunk/src/Listener.cxx
trunk/src/MsgBus.cxx
trunk/src/MsgHandler.cxx
trunk/src/Protocol.cxx
trunk/src/Reactor.cxx
trunk/src/RefCounter.cxx
trunk/src/SelectReactor.cxx
trunk/src/TCPLLTransport.cxx
trunk/src/TCPListener.cxx
trunk/src/TCPTransport.cxx
trunk/src/Timer.cxx
trunk/src/Transport.cxx
trunk/src/XMLParser.cxx
trunk/src/core.cxx
Added Paths:
-----------
trunk/include/asycxx/_asycxx.h
trunk/src/asycxx-common.h
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/configure.ac 2009-03-12 09:35:26 UTC (rev 6)
@@ -94,5 +94,5 @@
src/MsgHandler.h:include/asycxx/MsgHandler.h
src/GimpleMsgBus.h:include/asycxx/GimpleMsgBus.h
src/XMLParser.h:include/asycxx/XMLParser.h
- src/asycxx.h:include/asycxx/asycxx.h)
+ src/_asycxx.h:include/asycxx/_asycxx.h)
AC_OUTPUT
Modified: trunk/include/asycxx/DataBuffer.h
===================================================================
--- trunk/include/asycxx/DataBuffer.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/DataBuffer.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -19,7 +19,9 @@
#include <asycxx-config.h>
#endif
-#include "asycxx.h"
+#include <sys/types.h>
+
+#include "_asycxx.h"
#include "RefCounter.h"
class DataBuffer : public RefCounter
Modified: trunk/include/asycxx/Deferred.h
===================================================================
--- trunk/include/asycxx/Deferred.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/Deferred.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -15,7 +15,6 @@
#ifndef __HIPRO_ASYCXX__DEFERRED_H__
#define __HIPRO_ASYCXX__DEFERRED_H__
-#include "asycxx.h"
#include "Error.h"
typedef void (*cbDeferredOnEvent_t) (void *obj);
Modified: trunk/include/asycxx/Error.h
===================================================================
--- trunk/include/asycxx/Error.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/Error.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -19,7 +19,7 @@
#include <asycxx-config.h>
#endif
-#include "asycxx.h"
+#include <stdarg.h>
#define THROW(x, fmt, ...) throw x("[%s:%d] " fmt "\n", \
__FILE__, __LINE__, ##__VA_ARGS__)
Modified: trunk/include/asycxx/Factory.h
===================================================================
--- trunk/include/asycxx/Factory.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/Factory.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -19,7 +19,6 @@
#include <asycxx-config.h>
#endif
-#include "asycxx.h"
#include "Error.h"
#include "Reactor.h"
#include "Transport.h"
Modified: trunk/include/asycxx/GimpleMsgBus.h
===================================================================
--- trunk/include/asycxx/GimpleMsgBus.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/GimpleMsgBus.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -21,7 +21,6 @@
#include <deque>
-#include "asycxx.h"
#include "Error.h"
#include "Reactor.h"
#include "Protocol.h"
Modified: trunk/include/asycxx/Listener.h
===================================================================
--- trunk/include/asycxx/Listener.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/Listener.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -19,7 +19,6 @@
#include <asycxx-config.h>
#endif
-#include "asycxx.h"
#include "Error.h"
#include "Reactor.h"
Modified: trunk/include/asycxx/MsgBus.h
===================================================================
--- trunk/include/asycxx/MsgBus.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/MsgBus.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -17,7 +17,6 @@
#include <asycxx-config.h>
#endif
-#include "asycxx.h"
#include "DataBuffer.h"
/**
Modified: trunk/include/asycxx/MsgHandler.h
===================================================================
--- trunk/include/asycxx/MsgHandler.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/MsgHandler.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -17,7 +17,6 @@
#include <asycxx-config.h>
#endif
-#include "asycxx.h"
#include "DataBuffer.h"
#include "MsgBus.h"
Modified: trunk/include/asycxx/Protocol.h
===================================================================
--- trunk/include/asycxx/Protocol.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/Protocol.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -19,7 +19,6 @@
#include <asycxx-config.h>
#endif
-#include "asycxx.h"
#include "Error.h"
#include "Reactor.h"
#include "DataBuffer.h"
Modified: trunk/include/asycxx/Reactor.h
===================================================================
--- trunk/include/asycxx/Reactor.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/Reactor.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -21,7 +21,7 @@
#include <deque>
-#include "asycxx.h"
+#include "_asycxx.h"
#include "Deferred.h"
#define TIME_SENSITIVITY 200LL
Modified: trunk/include/asycxx/RefCounter.h
===================================================================
--- trunk/include/asycxx/RefCounter.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/RefCounter.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -19,7 +19,6 @@
#include <asycxx-config.h>
#endif
-#include "asycxx.h"
#include "Error.h"
class RefCounter
Modified: trunk/include/asycxx/SelectReactor.h
===================================================================
--- trunk/include/asycxx/SelectReactor.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/SelectReactor.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -23,7 +23,6 @@
#include <sys/select.h>
-#include "asycxx.h"
#include "Reactor.h"
class SelectReactor :public Reactor
Modified: trunk/include/asycxx/TCPLLTransport.h
===================================================================
--- trunk/include/asycxx/TCPLLTransport.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/TCPLLTransport.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -19,7 +19,6 @@
#include <asycxx-config.h>
#endif
-#include "asycxx.h"
#include "Reactor.h"
#include "TCPTransport.h"
Modified: trunk/include/asycxx/TCPListener.h
===================================================================
--- trunk/include/asycxx/TCPListener.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/TCPListener.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -22,7 +22,6 @@
#include <sys/types.h>
#include <arpa/inet.h>
-#include "asycxx.h"
#include "Error.h"
#include "Listener.h"
#include "Factory.h"
Modified: trunk/include/asycxx/TCPTransport.h
===================================================================
--- trunk/include/asycxx/TCPTransport.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/TCPTransport.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -19,7 +19,6 @@
#include <asycxx-config.h>
#endif
-#include "asycxx.h"
#include "Error.h"
#include "Reactor.h"
#include "DataBuffer.h"
Modified: trunk/include/asycxx/Timer.h
===================================================================
--- trunk/include/asycxx/Timer.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/Timer.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -21,7 +21,6 @@
#include <vector>
-#include "asycxx.h"
#include "Reactor.h"
Modified: trunk/include/asycxx/Transport.h
===================================================================
--- trunk/include/asycxx/Transport.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/Transport.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -21,7 +21,6 @@
#include <deque>
-#include "asycxx.h"
#include "Error.h"
#include "Reactor.h"
#include "DataBuffer.h"
Modified: trunk/include/asycxx/XMLParser.h
===================================================================
--- trunk/include/asycxx/XMLParser.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/XMLParser.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -18,7 +18,7 @@
#include <vector>
#include <hdb-tinyxml/tinyxml.h>
-#include "asycxx.h"
+#include "_asycxx.h"
class XMLParser
{
Copied: trunk/include/asycxx/_asycxx.h (from rev 5, trunk/src/MsgHandler.cxx)
===================================================================
--- trunk/include/asycxx/_asycxx.h (rev 0)
+++ trunk/include/asycxx/_asycxx.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -0,0 +1,38 @@
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi...
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ACW___ASYCXX_H__
+#define __HIPRO_ACW___ASYCXX_H__
+
+enum Result
+ {
+ Result_Success = 0,
+ Result_Error,
+ Result_Pending,
+ Result_NotFound,
+ };
+
+typedef unsigned char u8_t;
+typedef long long h_msecs_t;
+typedef long long h_timestamp_t;
+
+#endif /* __HIPRO_ACW___ASYCXX_H__ */
+
+/*
+ Local Variables:
+ mode: c++
+ indent-tabs-mode: nil
+ tab-width: 4
+ c-file-style: "gnu"
+ End:
+*/
Modified: trunk/include/asycxx/asycxx.h
===================================================================
--- trunk/include/asycxx/asycxx.h 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/include/asycxx/asycxx.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -1,71 +1,28 @@
-/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
-#ifndef __ACW__HMI_CTRL_H__
-#define __ACW__HMI_CTRL_H__
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi...
+ *
+ *******************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
+#ifndef __HIPRO_ACW__ASYCXX_H__
+#define __HIPRO_ACW__ASYCXX_H__
-#include "Logger.h"
+#include "_asycxx.h"
-extern Logger *Log;
+#endif /* __HIPRO_ACW__XML_PARSER_H__ */
-#define cERR(fmt, ...) fprintf (stderr, "[E:%18s:%04d] " fmt "\n", \
- __FILE__, __LINE__, ##__VA_ARGS__)
-#define ERR(fmt, ...) Log->LogThis ("[%20s:%04d] ERROR: " fmt "\n", \
- __FILE__, __LINE__, ##__VA_ARGS__)
-#define LOG(fmt, ...) Log->LogThis ("[%20s:%04d] " fmt "\n", \
- __FILE__, __LINE__, ##__VA_ARGS__)
-
-/* log messages to track ctor and dtor */
-#define ctorLOG(cls) Log->LogThis ("CTOR: %s <%p>\n", cls, this)
-#define dtorLOG(cls) Log->LogThis ("DTOR: %s <%p>\n", cls, this)
-
-#define dummyLog(fmt, ...)
-
-#if HMI_CTRL_VERBOSE_LEVEL >= 1
-#define LOG1 LOG
-#else
-#define LOG1 dummyLog
-#endif
-
-#if HMI_CTRL_VERBOSE_LEVEL >= 2
-#define LOG2 LOG
-#else
-#define LOG2 dummyLog
-#endif
-
-#if HMI_CTRL_VERBOSE_LEVEL >= 3
-#define LOG3 LOG
-#else
-#define LOG3 dummyLog
-#endif
-
-#define ASSERT(x, fmt, ...) \
- { \
- if (!(x)) \
- { \
- THROW (DevError, "assertion failed: %s, " fmt "\n", \
- #x, ##__VA_ARGS__); \
- } \
- }
-
-enum Result
- {
- Result_Success = 0,
- Result_Error,
- Result_Pending,
- Result_NotFound,
- };
-
-typedef unsigned char u8_t;
-typedef long long h_msecs_t;
-typedef long long h_timestamp_t;
-
-h_msecs_t GetCurrentTimeStamp (void);
-void SetFDAsNonBlocking (int fd);
-
-#define HMI_CTRL_MAX_URL_LEN 512
-#define HMI_CTRL_MAX_XPATH_LEN 1024
-
-#endif /* __ACW__HMI_CTRL_H__ */
+/*
+ Local Variables:
+ mode: c++
+ indent-tabs-mode: nil
+ tab-width: 4
+ c-file-style: "gnu"
+ End:
+*/
Modified: trunk/src/DataBuffer.cxx
===================================================================
--- trunk/src/DataBuffer.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/DataBuffer.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -16,6 +16,9 @@
#include <asycxx-config.h>
#endif
+#include <cstdlib>
+
+#include "asycxx-common.h"
#include "DataBuffer.h"
Modified: trunk/src/Error.cxx
===================================================================
--- trunk/src/Error.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/Error.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -20,7 +20,7 @@
#include <stdlib.h>
#include <execinfo.h>
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Error.h"
void
Modified: trunk/src/Factory.cxx
===================================================================
--- trunk/src/Factory.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/Factory.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -17,7 +17,7 @@
#endif
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Error.h"
#include "Reactor.h"
#include "Factory.h"
Modified: trunk/src/GimpleMsgBus.cxx
===================================================================
--- trunk/src/GimpleMsgBus.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/GimpleMsgBus.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -17,7 +17,7 @@
#include <string.h>
#include <arpa/inet.h>
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Error.h"
#include "Transport.h"
Modified: trunk/src/Listener.cxx
===================================================================
--- trunk/src/Listener.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/Listener.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -17,7 +17,7 @@
#endif
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Error.h"
#include "Listener.h"
Modified: trunk/src/MsgBus.cxx
===================================================================
--- trunk/src/MsgBus.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/MsgBus.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -14,7 +14,7 @@
#include <asycxx-config.h>
#endif
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Error.h"
#include "MsgBus.h"
#include "MsgHandler.h"
Modified: trunk/src/MsgHandler.cxx
===================================================================
--- trunk/src/MsgHandler.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/MsgHandler.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -14,7 +14,7 @@
#include <asycxx-config.h>
#endif
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Error.h"
#include "MsgHandler.h"
Modified: trunk/src/Protocol.cxx
===================================================================
--- trunk/src/Protocol.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/Protocol.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -17,7 +17,7 @@
#endif
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Error.h"
#include "Protocol.h"
Modified: trunk/src/Reactor.cxx
===================================================================
--- trunk/src/Reactor.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/Reactor.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -27,7 +27,7 @@
#include <unistd.h>
#include <exception>
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Reactor.h"
#include "Deferred.h"
Modified: trunk/src/RefCounter.cxx
===================================================================
--- trunk/src/RefCounter.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/RefCounter.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -16,7 +16,7 @@
#include <asycxx-config.h>
#endif
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Error.h"
#include "RefCounter.h"
Modified: trunk/src/SelectReactor.cxx
===================================================================
--- trunk/src/SelectReactor.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/SelectReactor.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -20,7 +20,7 @@
#include <errno.h>
#include <string.h>
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Error.h"
#include "SelectReactor.h"
Modified: trunk/src/TCPLLTransport.cxx
===================================================================
--- trunk/src/TCPLLTransport.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/TCPLLTransport.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -23,7 +23,7 @@
#include <netinet/in.h>
#include <netinet/tcp.h>
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Error.h"
#include "Protocol.h"
#include "TCPLLTransport.h"
Modified: trunk/src/TCPListener.cxx
===================================================================
--- trunk/src/TCPListener.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/TCPListener.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -26,7 +26,7 @@
#include <errno.h>
#include <unistd.h>
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Error.h"
#include "Factory.h"
#include "Protocol.h"
Modified: trunk/src/TCPTransport.cxx
===================================================================
--- trunk/src/TCPTransport.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/TCPTransport.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -24,7 +24,7 @@
#include <sys/socket.h>
#include <errno.h>
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Error.h"
#include "Protocol.h"
#include "TCPTransport.h"
Modified: trunk/src/Timer.cxx
===================================================================
--- trunk/src/Timer.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/Timer.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -44,7 +44,7 @@
#include <vector>
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Error.h"
#include "Timer.h"
Modified: trunk/src/Transport.cxx
===================================================================
--- trunk/src/Transport.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/Transport.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -18,7 +18,7 @@
#include <unistd.h>
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Error.h"
#include "Transport.h"
#include "Protocol.h"
Modified: trunk/src/XMLParser.cxx
===================================================================
--- trunk/src/XMLParser.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/XMLParser.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -20,8 +20,8 @@
#include <stdlib.h>
#include <errno.h>
+#include "asycxx-common.h"
#include "XMLParser.h"
-#include "asycxx.h"
#include "Error.h"
#include <hdb-tinyxml/tinyxml.h>
Copied: trunk/src/asycxx-common.h (from rev 5, trunk/include/asycxx/asycxx.h)
===================================================================
--- trunk/src/asycxx-common.h (rev 0)
+++ trunk/src/asycxx-common.h 2009-03-12 09:35:26 UTC (rev 6)
@@ -0,0 +1,80 @@
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __ACW_ASYCXX__ASYCXX_COMMON_H__
+#define __ACW_ASYCXX__ASYCXX_COMMON_H__
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "_asycxx.h"
+#include "Logger.h"
+
+extern Logger *Log;
+
+#define cERR(fmt, ...) fprintf (stderr, "[E:%18s:%04d] " fmt "\n", \
+ __FILE__, __LINE__, ##__VA_ARGS__)
+#define ERR(fmt, ...) Log->LogThis ("[%20s:%04d] ERROR: " fmt "\n", \
+ __FILE__, __LINE__, ##__VA_ARGS__)
+#define LOG(fmt, ...) Log->LogThis ("[%20s:%04d] " fmt "\n", \
+ __FILE__, __LINE__, ##__VA_ARGS__)
+
+/* log messages to track ctor and dtor */
+#define ctorLOG(cls) Log->LogThis ("CTOR: %s <%p>\n", cls, this)
+#define dtorLOG(cls) Log->LogThis ("DTOR: %s <%p>\n", cls, this)
+
+#define dummyLog(fmt, ...)
+
+#if HMI_CTRL_VERBOSE_LEVEL >= 1
+#define LOG1 LOG
+#else
+#define LOG1 dummyLog
+#endif
+
+#if HMI_CTRL_VERBOSE_LEVEL >= 2
+#define LOG2 LOG
+#else
+#define LOG2 dummyLog
+#endif
+
+#if HMI_CTRL_VERBOSE_LEVEL >= 3
+#define LOG3 LOG
+#else
+#define LOG3 dummyLog
+#endif
+
+#define ASSERT(x, fmt, ...) \
+ { \
+ if (!(x)) \
+ { \
+ THROW (DevError, "assertion failed: %s, " fmt "\n", \
+ #x, ##__VA_ARGS__); \
+ } \
+ }
+
+h_msecs_t GetCurrentTimeStamp (void);
+void SetFDAsNonBlocking (int fd);
+
+#define HMI_CTRL_MAX_URL_LEN 512
+#define HMI_CTRL_MAX_XPATH_LEN 1024
+
+#endif /* __ACW_ASYCXX__ASYCXX_COMMON_H__ */
+
+/*
+ Local Variables:
+ mode: c++
+ indent-tabs-mode: nil
+ tab-width: 4
+ c-file-style: "gnu"
+ End:
+*/
Modified: trunk/src/core.cxx
===================================================================
--- trunk/src/core.cxx 2009-02-20 19:18:20 UTC (rev 5)
+++ trunk/src/core.cxx 2009-03-12 09:35:26 UTC (rev 6)
@@ -22,7 +22,7 @@
#include <unistd.h>
#include <fcntl.h>
-#include "asycxx.h"
+#include "asycxx-common.h"
#include "Error.h"
h_msecs_t
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Karthik B. <ka...@hi...> - 2009-02-25 04:38:44
|
On Tue, Feb 24, 2009 at 4:34 PM, Joe Steeve <js...@hi...> wrote: > Did you try out a test application for the library? A little held up @ office.. Should be able to update you before this Friday. -- Karthik HiPro IT Solutions Pvt. Ltd. http://hipro.co.in/ |
|
From: Joe S. <js...@hi...> - 2009-02-24 11:05:01
|
Karthik, Did you try out a test application for the library? -- Joe Steeve HiPro IT Solutions Pvt. Ltd. http://hipro.co.in/ |
|
From: <kar...@us...> - 2009-02-20 19:18:26
|
Revision: 5
http://asycxx.svn.sourceforge.net/asycxx/?rev=5&view=rev
Author: karthikbk
Date: 2009-02-20 19:18:20 +0000 (Fri, 20 Feb 2009)
Log Message:
-----------
fixed build system to build asycxx as a library
* removed references to hmi-ctrl
* removed un-necessary autoconf macros in configure.ac
* using libtool now to build the library
Modified Paths:
--------------
trunk/include/Makefile.am
Modified: trunk/include/Makefile.am
===================================================================
--- trunk/include/Makefile.am 2009-02-20 18:58:54 UTC (rev 4)
+++ trunk/include/Makefile.am 2009-02-20 19:18:20 UTC (rev 5)
@@ -19,4 +19,5 @@
asycxx/MsgBus.h \
asycxx/MsgHandler.h \
asycxx/GimpleMsgBus.h \
- asycxx/XMLParser.h
+ asycxx/XMLParser.h \
+ asycxx/asycxx.h
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2009-02-20 18:59:09
|
Revision: 4
http://asycxx.svn.sourceforge.net/asycxx/?rev=4&view=rev
Author: karthikbk
Date: 2009-02-20 18:58:54 +0000 (Fri, 20 Feb 2009)
Log Message:
-----------
Initial Version.
Asycxx v. 0.1
Modified Paths:
--------------
trunk/Makefile.am
trunk/autogen.sh
trunk/configure.ac
trunk/src/DataBuffer.cxx
trunk/src/Deferred.cxx
trunk/src/Error.cxx
trunk/src/Factory.cxx
trunk/src/GimpleMsgBus.cxx
trunk/src/Listener.cxx
trunk/src/Logger.cxx
trunk/src/Makefile.am
trunk/src/MsgBus.cxx
trunk/src/MsgHandler.cxx
trunk/src/Protocol.cxx
trunk/src/Reactor.cxx
trunk/src/RefCounter.cxx
trunk/src/SelectReactor.cxx
trunk/src/TCPLLTransport.cxx
trunk/src/TCPListener.cxx
trunk/src/TCPTransport.cxx
trunk/src/Timer.cxx
trunk/src/Transport.cxx
trunk/src/XMLParser.cxx
trunk/src/core.cxx
Added Paths:
-----------
trunk/asycxx-0.1.pc.in
trunk/asycxx-config.h.in
trunk/include/
trunk/include/Makefile.am
trunk/include/asycxx/
trunk/include/asycxx/DataBuffer.h
trunk/include/asycxx/Deferred.h
trunk/include/asycxx/Error.h
trunk/include/asycxx/Factory.h
trunk/include/asycxx/GimpleMsgBus.h
trunk/include/asycxx/Listener.h
trunk/include/asycxx/Logger.h
trunk/include/asycxx/MsgBus.h
trunk/include/asycxx/MsgHandler.h
trunk/include/asycxx/Protocol.h
trunk/include/asycxx/Reactor.h
trunk/include/asycxx/RefCounter.h
trunk/include/asycxx/SelectReactor.h
trunk/include/asycxx/TCPLLTransport.h
trunk/include/asycxx/TCPListener.h
trunk/include/asycxx/TCPTransport.h
trunk/include/asycxx/Timer.h
trunk/include/asycxx/Transport.h
trunk/include/asycxx/XMLParser.h
trunk/include/asycxx/asycxx.h
Removed Paths:
-------------
trunk/hmi-ctrl-config.h
trunk/hmi-ctrl-config.h.in
trunk/hmi-ctrl-config.xml.sample
trunk/src/App.cxx
trunk/src/App.h
trunk/src/Config.cxx
trunk/src/Config.h
trunk/src/DataBuffer.h
trunk/src/Deferred.h
trunk/src/Error.h
trunk/src/Factory.h
trunk/src/GimpleMsgBus.h
trunk/src/Listener.h
trunk/src/Logger.h
trunk/src/MsgBus.h
trunk/src/MsgHandler.h
trunk/src/Protocol.h
trunk/src/Reactor.h
trunk/src/RefCounter.h
trunk/src/SelectReactor.h
trunk/src/TCPLLTransport.h
trunk/src/TCPListener.h
trunk/src/TCPTransport.h
trunk/src/Timer.h
trunk/src/Transport.h
trunk/src/XMLParser.h
trunk/src/hmi-ctrl.cxx
trunk/src/hmi-ctrl.h
Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am 2009-02-05 20:57:10 UTC (rev 3)
+++ trunk/Makefile.am 2009-02-20 18:58:54 UTC (rev 4)
@@ -1,5 +1,5 @@
# -*- mode: makefile; indent-tabs-mode: nil; tab-width: 4; -*-
-configdir = $(sysconfdir)/hmi-ctrl
-dist_config_DATA = hmi-ctrl-config.xml.sample
+SUBDIRS = src include
-SUBDIRS = src
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = asycxx-0.1.pc
Added: trunk/asycxx-0.1.pc.in
===================================================================
--- trunk/asycxx-0.1.pc.in (rev 0)
+++ trunk/asycxx-0.1.pc.in 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: asycxx.0
+Description: ASYCxx
+Version: @VERSION@
+Libs: -L${libdir} -lasycxx-0.1
+Cflags: -I${includedir}
Added: trunk/asycxx-config.h.in
===================================================================
--- trunk/asycxx-config.h.in (rev 0)
+++ trunk/asycxx-config.h.in 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,72 @@
+/* asycxx-config.h.in. Generated from configure.ac by autoheader. */
+
+/* Release tag associated with the build */
+#undef ASYCXX_RELEASE_TAG
+
+/* SCM revision number */
+#undef ASYCXX_REVISION
+
+/* Controls the amount of logs */
+#undef ASYCXX_VERBOSE_LEVEL
+
+/* Enable/Disable sanity checks */
+#undef ENABLE_SANITY_CHECKS
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
Modified: trunk/autogen.sh
===================================================================
--- trunk/autogen.sh 2009-02-05 20:57:10 UTC (rev 3)
+++ trunk/autogen.sh 2009-02-20 18:58:54 UTC (rev 4)
@@ -2,5 +2,6 @@
echo "Generating build necessaries..."
aclocal
+libtoolize --force
automake --add-missing
autoconf
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2009-02-05 20:57:10 UTC (rev 3)
+++ trunk/configure.ac 2009-02-20 18:58:54 UTC (rev 4)
@@ -1,6 +1,8 @@
-AC_INIT([hmi-ctrl], [0.1], jo...@hi...)
+AC_INIT([asycxx], [0.1], jo...@hi...)
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
+AC_PREFIX_DEFAULT(/opt/asycxx)
+
CFLAGS="-Wall -Werror"
CXXFLAGS="-Wall -Werror"
@@ -8,59 +10,49 @@
AC_ARG_WITH(verbose-level,
AS_HELP_STRING([--with-verbose-level],
[Use the given debug level (0 to 3) 0=disable]),
- [hmi_ctrl_with_verbose_level=$withval],)
+ [asycxx_with_verbose_level=$withval],)
-if test $hmi_ctrl_with_verbose_level; then
- HMI_CTRL_verbose_level=$hmi_ctrl_with_verbose_level
+if test $asycxx_with_verbose_level; then
+ ASYCXX_verbose_level=$asycxx_with_verbose_level
else
- HMI_CTRL_verbose_level=2
+ ASYCXX_verbose_level=2
fi
-AC_DEFINE_UNQUOTED(HMI_CTRL_VERBOSE_LEVEL, $HMI_CTRL_verbose_level,
+AC_DEFINE_UNQUOTED(ASYCXX_VERBOSE_LEVEL, $ASYCXX_verbose_level,
[Controls the amount of logs])
dnl SCM revision tag
-HMI_CTRL_revision=`svn info | grep "^Revision" | cut -d' ' -f 2 -s`
-if [[ "$HMI_CTRL_revision" = "" ]]; then
- HMI_CTRL_revision="unknown"
+ASYCXX_revision=`svn info | grep "^Revision" | cut -d' ' -f 2 -s`
+if [[ "$ASYCXX_revision" = "" ]]; then
+ ASYCXX_revision="unknown"
fi
-AC_DEFINE_UNQUOTED(HMI_CTRL_REVISION, "$HMI_CTRL_revision",
+AC_DEFINE_UNQUOTED(ASYCXX_REVISION, "$ASYCXX_revision",
[SCM revision number])
dnl setup a release tag
AC_ARG_WITH(release-tag,
AS_HELP_STRING([--with-release-tag],
[Release tag to associate with the build]),
- [HMI_CTRL_release_tag=$withval],)
+ [ASYCXX_release_tag=$withval],)
-if test -z $HMI_CTRL_release_tag; then
- HMI_CTRL_release_tag="<DEBUG:Rev=$HMI_CTRL_revision>"
+if test -z $ASYCXX_release_tag; then
+ ASYCXX_release_tag="<DEBUG:Rev=$ASYCXX_revision>"
fi
-AC_DEFINE_UNQUOTED(HMI_CTRL_RELEASE_TAG, "$HMI_CTRL_release_tag",
+AC_DEFINE_UNQUOTED(ASYCXX_RELEASE_TAG, "$ASYCXX_release_tag",
[Release tag associated with the build])
-
-dnl setup the acw-common
-ACW_COMMON_Folder=`pwd`/../acw-common
-CFLAGS="$CFLAGS -I $ACW_COMMON_Folder"
-CXXFLAGS="$CXXFLAGS -I $ACW_COMMON_Folder"
-dnl setup the hmi-common
-HMI_COMMON_Folder=`pwd`/../hmi-common
-CFLAGS="$CFLAGS -I $HMI_COMMON_Folder"
-CXXFLAGS="$CXXFLAGS -I $HMI_COMMON_Folder"
-
dnl enable/disable sanity checks
AC_ARG_ENABLE(sanity-checks,
AS_HELP_STRING([--enable-sanity-checks],
[Enable all sanity checks]),
[
if [[ "$enableval" = "yes" ]]; then
- HMI_CTRL_sanity_checks=1
+ ASYCXX_sanity_checks=1
else
- HMI_CTRL_sanity_checks=0
+ ASYCXX_sanity_checks=0
fi
],
- [HMI_CTRL_sanity_checks=1])
-AC_DEFINE_UNQUOTED(ENABLE_SANITY_CHECKS, $HMI_CTRL_sanity_checks,
+ [ASYCXX_sanity_checks=1])
+AC_DEFINE_UNQUOTED(ENABLE_SANITY_CHECKS, $ASYCXX_sanity_checks,
[Enable/Disable sanity checks])
dnl check for libhdb-tinyxml
@@ -74,10 +66,33 @@
AC_PROG_CXX
AC_GNU_SOURCE
+AC_PROG_LIBTOOL
-AC_CONFIG_HEADERS([hmi-ctrl-config.h])
+AC_CONFIG_HEADERS([asycxx-config.h])
AC_CONFIG_FILES([
Makefile
src/Makefile
+include/Makefile
+asycxx-0.1.pc
])
+AC_CONFIG_LINKS(src/Logger.h:include/asycxx/Logger.h
+ src/Error.h:include/asycxx/Error.h
+ src/Deferred.h:include/asycxx/Deferred.h
+ src/RefCounter.h:include/asycxx/RefCounter.h
+ src/DataBuffer.h:include/asycxx/DataBuffer.h
+ src/Reactor.h:include/asycxx/Reactor.h
+ src/SelectReactor.h:include/asycxx/SelectReactor.h
+ src/Timer.h:include/asycxx/Timer.h
+ src/Transport.h:include/asycxx/Transport.h
+ src/Listener.h:include/asycxx/Listener.h
+ src/TCPTransport.h:include/asycxx/TCPTransport.h
+ src/TCPListener.h:include/asycxx/TCPListener.h
+ src/TCPLLTransport.h:include/asycxx/TCPLLTransport.h
+ src/Protocol.h:include/asycxx/Protocol.h
+ src/Factory.h:include/asycxx/Factory.h
+ src/MsgBus.h:include/asycxx/MsgBus.h
+ src/MsgHandler.h:include/asycxx/MsgHandler.h
+ src/GimpleMsgBus.h:include/asycxx/GimpleMsgBus.h
+ src/XMLParser.h:include/asycxx/XMLParser.h
+ src/asycxx.h:include/asycxx/asycxx.h)
AC_OUTPUT
Deleted: trunk/hmi-ctrl-config.h
===================================================================
--- trunk/hmi-ctrl-config.h 2009-02-05 20:57:10 UTC (rev 3)
+++ trunk/hmi-ctrl-config.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -1,40 +0,0 @@
-/* hmi-ctrl-config.h. Generated from hmi-ctrl-config.h.in by configure. */
-/* hmi-ctrl-config.h.in. Generated from configure.ac by autoheader. */
-
-/* Enable/Disable sanity checks */
-#define ENABLE_SANITY_CHECKS 1
-
-/* Release tag associated with the build */
-#define HMI_CTRL_RELEASE_TAG "<DEBUG:Rev=unknown>"
-
-/* SCM revision number */
-#define HMI_CTRL_REVISION "unknown"
-
-/* Controls the amount of logs */
-#define HMI_CTRL_VERBOSE_LEVEL 2
-
-/* Name of package */
-#define PACKAGE "hmi-ctrl"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "jo...@hi..."
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "hmi-ctrl"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "hmi-ctrl 0.1"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "hmi-ctrl"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "0.1"
-
-/* Version number of package */
-#define VERSION "0.1"
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
Deleted: trunk/hmi-ctrl-config.h.in
===================================================================
--- trunk/hmi-ctrl-config.h.in 2009-02-05 20:57:10 UTC (rev 3)
+++ trunk/hmi-ctrl-config.h.in 2009-02-20 18:58:54 UTC (rev 4)
@@ -1,39 +0,0 @@
-/* hmi-ctrl-config.h.in. Generated from configure.ac by autoheader. */
-
-/* Enable/Disable sanity checks */
-#undef ENABLE_SANITY_CHECKS
-
-/* Release tag associated with the build */
-#undef HMI_CTRL_RELEASE_TAG
-
-/* SCM revision number */
-#undef HMI_CTRL_REVISION
-
-/* Controls the amount of logs */
-#undef HMI_CTRL_VERBOSE_LEVEL
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Version number of package */
-#undef VERSION
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
Deleted: trunk/hmi-ctrl-config.xml.sample
===================================================================
--- trunk/hmi-ctrl-config.xml.sample 2009-02-05 20:57:10 UTC (rev 3)
+++ trunk/hmi-ctrl-config.xml.sample 2009-02-20 18:58:54 UTC (rev 4)
@@ -1,28 +0,0 @@
-<hmi-ctrl-config>
- <spindle-count>64</spindle-count>
-
- <spindle-ctrl>
- <ip>0.0.0.0</ip>
- <port>10000</port>
- </spindle-ctrl>
-
- <doffer-ctrl>
- <ip>0.0.0.0</ip>
- <port>10001</port>
- </doffer-ctrl>
-
- <hstock-ctrl>
- <ip>0.0.0.0</ip>
- <port>10002</port>
- </hstock-ctrl>
-
- <rpc-local>
- <ip>127.0.0.1</ip>
- <port>10010</port>
- </rpc-local>
-
- <rpc-public>
- <ip>0.0.0.0</ip>
- <port>10011</port>
- </rpc-public>
-</hmi-ctrl-config>
Added: trunk/include/Makefile.am
===================================================================
--- trunk/include/Makefile.am (rev 0)
+++ trunk/include/Makefile.am 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,22 @@
+# -*- mode: makefile; indent-tabs-mode: nil; tab-width: 4; -*-
+
+pkginclude_HEADERS = \
+ asycxx/Logger.h \
+ asycxx/Error.h \
+ asycxx/Deferred.h \
+ asycxx/RefCounter.h \
+ asycxx/DataBuffer.h \
+ asycxx/Reactor.h \
+ asycxx/SelectReactor.h \
+ asycxx/Timer.h \
+ asycxx/Transport.h \
+ asycxx/Listener.h \
+ asycxx/TCPTransport.h \
+ asycxx/TCPListener.h \
+ asycxx/TCPLLTransport.h \
+ asycxx/Protocol.h \
+ asycxx/Factory.h \
+ asycxx/MsgBus.h \
+ asycxx/MsgHandler.h \
+ asycxx/GimpleMsgBus.h \
+ asycxx/XMLParser.h
Added: trunk/include/asycxx/DataBuffer.h
===================================================================
--- trunk/include/asycxx/DataBuffer.h (rev 0)
+++ trunk/include/asycxx/DataBuffer.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,58 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__DATA_BUFFER_H__
+#define __HIPRO_ASYCXX__DATA_BUFFER_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include "asycxx.h"
+#include "RefCounter.h"
+
+class DataBuffer : public RefCounter
+{
+public:
+ /* ctors */
+ DataBuffer (size_t len);
+ DataBuffer (void *buffer, size_t len);
+
+ /* Accessors */
+ void * Data (void) { return m_Data; }
+ size_t Len (void) { return m_DataLen; }
+ void Len (size_t len);
+ size_t BufferLen (void) { return m_BufferLen; }
+ void Processed (size_t len);
+ size_t Processed (void) { return m_ProcessedLen; }
+ void * UnProcessed (void);
+
+protected:
+ /* dtors */
+ ~DataBuffer ();
+
+private:
+ /* initializer */
+ void _init (void);
+
+ /* The buffer */
+ void *m_Data;
+
+ /* meta-data about the buffer and its contents */
+ size_t m_BufferLen; /* Maximum length of the buffer */
+ size_t m_DataLen; /* Length of data held in the buffer */
+ size_t m_ProcessedLen; /* Length of data processed */
+};
+
+#endif /* __HIPRO_ASYCXX__DATA_BUFFER_H__ */
Added: trunk/include/asycxx/Deferred.h
===================================================================
--- trunk/include/asycxx/Deferred.h (rev 0)
+++ trunk/include/asycxx/Deferred.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,52 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__DEFERRED_H__
+#define __HIPRO_ASYCXX__DEFERRED_H__
+
+#include "asycxx.h"
+#include "Error.h"
+
+typedef void (*cbDeferredOnEvent_t) (void *obj);
+typedef void (*cbDeferredOnError_t) (void *obj);
+typedef void (*cbDeferredOnTimeout_t) (void *obj, h_msecs_t excess_time);
+
+class Deferred
+{
+
+public:
+ Deferred ();
+ ~Deferred ();
+
+ Deferred * OnEvent (cbDeferredOnEvent_t cb_fn, void *cb_obj) throw ();
+ Deferred * OnError (cbDeferredOnError_t cb_fn, void *cb_obj) throw ();
+ Deferred * OnTimeout (cbDeferredOnTimeout_t cb_fn, void *cb_obj) throw ();
+
+ void NotifyEvent (void);
+ void NotifyError (void);
+ void NotifyTimeout (h_msecs_t excess_time);
+
+private:
+ cbDeferredOnEvent_t m_cbOnEvent;
+ void * m_cbOnEvent_obj;
+
+ cbDeferredOnError_t m_cbOnError;
+ void * m_cbOnError_obj;
+
+ cbDeferredOnTimeout_t m_cbOnTimeout;
+ void * m_cbOnTimeout_obj;
+
+};
+
+#endif // __HIPRO_ASYCXX__DEFERRED_H__
Added: trunk/include/asycxx/Error.h
===================================================================
--- trunk/include/asycxx/Error.h (rev 0)
+++ trunk/include/asycxx/Error.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,70 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO__ERROR_H__
+#define __HIPRO__ERROR_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include "asycxx.h"
+
+#define THROW(x, fmt, ...) throw x("[%s:%d] " fmt "\n", \
+ __FILE__, __LINE__, ##__VA_ARGS__)
+
+#define ExpMSG_LEN 1024
+
+class Error
+{
+public:
+ Error () {}
+ Error (const char *fmt, ...)
+ {
+ va_list args;
+ va_start (args, fmt);
+ doError (fmt, args);
+ va_end (args);
+ }
+ virtual ~Error () {}
+
+protected:
+ void doError (const char *fmt, va_list vargs);
+ virtual const char *GetErrorName (void) { return "Unknown error"; }
+};
+
+#define CREATE_ERROR(err, berr, name) \
+ class err : public berr \
+ { \
+public: \
+ err () {} \
+ err (const char *fmt, ...) \
+ { \
+ va_list args; \
+ va_start (args, fmt); \
+ doError (fmt, args); \
+ va_end (args); \
+ } \
+protected: \
+ virtual const char *GetErrorName (void) { return name; } \
+ }
+
+CREATE_ERROR (FatalError, Error, "unknown FatalError");
+CREATE_ERROR (OutOfMemoryError, FatalError, "OutOfMemoryError");
+CREATE_ERROR (DevError, FatalError, "DevError");
+CREATE_ERROR (RunTimeError, FatalError, "RunTimeError");
+
+CREATE_ERROR (RecoverableError, Error, "unknown RecoverableError");
+CREATE_ERROR (BadFDError, RecoverableError, "BadFDError");
+#endif /* __HIPRO_ASYCXX__ERROR_H__ */
Added: trunk/include/asycxx/Factory.h
===================================================================
--- trunk/include/asycxx/Factory.h (rev 0)
+++ trunk/include/asycxx/Factory.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,38 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__FACTORY_H__
+#define __HIPRO_ASYCXX__FACTORY_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include "asycxx.h"
+#include "Error.h"
+#include "Reactor.h"
+#include "Transport.h"
+
+class Factory
+{
+public:
+ Factory (Reactor *reactor);
+ virtual ~Factory ();
+ virtual Protocol *GetProtocol (Transport *trans) = 0;
+
+protected:
+ Reactor *m_Reactor;
+};
+
+#endif /* __HIPRO_ASYCXX__FACTORY_H__ */
Added: trunk/include/asycxx/GimpleMsgBus.h
===================================================================
--- trunk/include/asycxx/GimpleMsgBus.h (rev 0)
+++ trunk/include/asycxx/GimpleMsgBus.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,97 @@
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__GIMPLE_MSG_BUS_H__
+#define __HIPRO_ASYCXX__GIMPLE_MSG_BUS_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include <stdint.h>
+
+#include <deque>
+
+#include "asycxx.h"
+#include "Error.h"
+#include "Reactor.h"
+#include "Protocol.h"
+#include "MsgBus.h"
+
+/**
+ * \author Joe Steeve, jo...@hi...
+ * \class GimpleMsgBus
+ *
+ * \brief A down-to-earth simple message-bus
+ *
+ * \details This class implements a simple message-bus without any
+ * bells or whistles. It simply breaks down incoming data into
+ * messages and passes them on to the MsgHandler. Data submitted to
+ * this class by the MsgHandler is wrapped with a header and sent to
+ * the Transport.
+ */
+
+class GimpleMsgBus : public Protocol, public MsgBus
+{
+
+public:
+ GimpleMsgBus (Reactor *reactor, Factory *factory, Transport *transport,
+ MsgHandler *handler);
+ ~GimpleMsgBus ();
+
+ void DataAvailable (DataBuffer *data);
+ void ReadError (void);
+ void WriteError (void);
+ void ReadTimeout (h_msecs_t excess_time);
+ void WriteTimeout (h_msecs_t excess_time);
+ void SendMsg (DataBuffer *msg);
+
+protected:
+ Result InitProtocol (void);
+
+private:
+ struct GMBPacketHdr_s
+ {
+ char signature [4]; /* should contain "GMB\0" */
+ uint32_t len; /* length of the xml-packet in
+ network-byte-order. */
+ } __attribute__ ((packed));
+
+ enum GMBState
+ {
+ GMB_WaitingForNewMsg = 0,
+ GMB_MsgHarvestInProgress
+ };
+ GMBState m_State;
+
+ GMBPacketHdr_s m_Hdr;
+ size_t m_Hdr_filled;
+ size_t m_Hdr_left;
+
+ DataBuffer *m_Payload;
+ size_t m_Payload_filled;
+ size_t m_Payload_left;
+
+ Result ReadHeader (void *data_ptr, size_t len, size_t& processed);
+ Result ReadPayload (void *data_ptr, size_t len, size_t& processed);
+};
+
+#endif /* __HIPRO_ASYCXX__GIMPLE_MSG_BUS_H__ */
+
+/*
+ Local Variables:
+ mode: c++
+ indent-tabs-mode: nil
+ tab-width: 4
+ c-file-style: "gnu"
+ End:
+*/
Added: trunk/include/asycxx/Listener.h
===================================================================
--- trunk/include/asycxx/Listener.h (rev 0)
+++ trunk/include/asycxx/Listener.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,35 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__LISTENER_H__
+#define __HIPRO_ASYCXX__LISTENER_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include "asycxx.h"
+#include "Error.h"
+#include "Reactor.h"
+
+class Listener
+{
+
+public:
+ Listener ();
+ virtual ~Listener ();
+
+};
+
+#endif /* __HIPRO_ASYCXX__LISTENER_H__ */
Added: trunk/include/asycxx/Logger.h
===================================================================
--- trunk/include/asycxx/Logger.h (rev 0)
+++ trunk/include/asycxx/Logger.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,38 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO__LOGGER_H__
+#define __HIPRO__LOGGER_H__
+
+#include <stdarg.h>
+
+class Logger
+{
+public:
+ Logger ();
+ ~Logger ();
+
+ void LogThis (const char *fmt, ...);
+
+ void EnableConsole (void);
+ void DisableConsole (void);
+
+private:
+ bool m_logToConsole;
+
+ void LogToConsole (const char *fmt, va_list args);
+// void LogToFile (const char *fmt, va_list args);
+};
+
+#endif // __HIPRO__LOGGER_H__
Added: trunk/include/asycxx/MsgBus.h
===================================================================
--- trunk/include/asycxx/MsgBus.h (rev 0)
+++ trunk/include/asycxx/MsgBus.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,57 @@
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__MSG_BUS_H__
+#define __HIPRO_ASYCXX__MSG_BUS_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include "asycxx.h"
+#include "DataBuffer.h"
+
+/**
+ * \author Joe Steeve, jo...@hi...
+ * \class MsgBus
+ *
+ * \brief The interface of a MsgBus
+ *
+ * \details This class requires a MsgHandler to be provided at the
+ * time of construction. This class assumes ownership of the
+ * MsgHandler and destroys it when this is destroyed.
+ */
+class MsgHandler;
+
+class MsgBus
+{
+public:
+ MsgBus (MsgHandler *handler);
+ virtual ~MsgBus ();
+
+ virtual void SendMsg (DataBuffer *msg) = 0;
+
+protected:
+ MsgHandler *m_Handler;
+
+};
+
+#endif /* __HIPRO_ASYCXX__MSG_BUS_H__ */
+
+/*
+ Local Variables:
+ mode: c++
+ indent-tabs-mode: nil
+ tab-width: 4
+ c-file-style: "gnu"
+ End:
+*/
Added: trunk/include/asycxx/MsgHandler.h
===================================================================
--- trunk/include/asycxx/MsgHandler.h (rev 0)
+++ trunk/include/asycxx/MsgHandler.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,54 @@
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__MSG_HANDLER_H__
+#define __HIPRO_ASYCXX__MSG_HANDLER_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include "asycxx.h"
+#include "DataBuffer.h"
+#include "MsgBus.h"
+
+
+/**
+ * \author Joe Steeve, jo...@hi...
+ * \class MsgHandler
+ *
+ * \brief The interface of a MsgHandler
+ */
+
+class MsgHandler
+{
+public:
+ MsgHandler ();
+ virtual ~MsgHandler ();
+
+ void SetMsgBus (MsgBus *bus);
+ virtual Result GotMsg (DataBuffer *data) = 0;
+
+protected:
+ MsgBus *m_Bus;
+};
+
+#endif /* __HIPRO_ASYCXX__MSG_HANDLER_H__ */
+
+/*
+ Local Variables:
+ mode: c++
+ indent-tabs-mode: nil
+ tab-width: 4
+ c-file-style: "gnu"
+ End:
+*/
Added: trunk/include/asycxx/Protocol.h
===================================================================
--- trunk/include/asycxx/Protocol.h (rev 0)
+++ trunk/include/asycxx/Protocol.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,57 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__PROTOCOL_H__
+#define __HIPRO_ASYCXX__PROTOCOL_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include "asycxx.h"
+#include "Error.h"
+#include "Reactor.h"
+#include "DataBuffer.h"
+#include "Transport.h"
+#include "Factory.h"
+
+#define ASYCXX_DEFAULT_PROTOCOL_BUFSIZE 1024
+
+class Protocol
+{
+public:
+ Protocol (Reactor *reactor, Factory *factory, Transport *transport);
+ virtual ~Protocol ();
+
+ void BuildProtocol (void);
+ /* Methods exposed for the 'transport' to send msgs to the
+ Protocol */
+ virtual void DataAvailable (DataBuffer *data);
+ virtual void ConnectionLost (void);
+ virtual void ReadTimeout (h_msecs_t excess_time);
+ virtual void ReadError (void);
+ virtual void WriteTimeout (h_msecs_t excess_time);
+ virtual void WriteError (void);
+
+protected:
+ Reactor *m_Reactor;
+ Factory *m_Factory;
+ Transport *m_Transport;
+
+ /* Interface that should be implemented by all protocol
+ sub-classes */
+ virtual Result InitProtocol (void);
+};
+
+#endif /* __HIPRO_ASYCXX__PROTOCOL_H__ */
Added: trunk/include/asycxx/Reactor.h
===================================================================
--- trunk/include/asycxx/Reactor.h (rev 0)
+++ trunk/include/asycxx/Reactor.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,89 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__REACTOR_H__
+#define __HIPRO_ASYCXX__REACTOR_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include <deque>
+
+#include "asycxx.h"
+#include "Deferred.h"
+
+#define TIME_SENSITIVITY 200LL
+
+class Reactor
+{
+public:
+ Reactor ();
+ virtual ~Reactor ();
+
+ Deferred * OnReadable (int Fd) throw ();
+ Deferred * OnReadable (int Fd, h_msecs_t timeoutTime) throw ();
+ Deferred * OnWritable (int Fd) throw ();
+ Deferred * OnWritable (int Fd, h_msecs_t timeoutTime) throw ();
+ Deferred * OnTimeElapsed (h_msecs_t timeoutTime) throw ();
+ void UnRegister (Deferred *deferred) throw ();
+
+ h_timestamp_t CurrentTS (void) { return m_LastAwokenTS; }
+ void Run (void);
+
+protected:
+ class Event
+ {
+ public:
+ Event ();
+ ~Event ();
+
+ bool m_bDie;
+
+ int m_Fd;
+ h_msecs_t m_TimeoutTime;
+ h_timestamp_t m_LastTriggerTS;
+ h_timestamp_t m_NextTriggerTS;
+ Deferred m_Deferred;
+ };
+ std::deque<Event *> m_readEvents;
+ std::deque<Event *> m_writeEvents;
+ std::deque<Event *> m_timeEvents;
+
+ int m_PendingFDEvents;
+ virtual void WaitForEvents (void) = 0;
+ virtual void ProcessFDEvents (void) = 0;
+
+ /**
+ * \brief The TimeStamp when latest activity happened
+ *
+ * \detail This holds the last time-stamp when the reactor was doing
+ * something. This should be updated by Reactor implementations
+ * (Select, Epoll, etc.) everytime they wake up to do something
+ * (attend to file-descriptor activity or handle timeout actions
+ */
+ h_timestamp_t m_LastAwokenTS;
+ void DoFDEventNotification (Reactor::Event *ev);
+ void DoFDTimeoutNotification (Reactor::Event *ev);
+
+private:
+ void ProcessTimeEvents (void);
+ void ProcessFDTimeouts (void);
+ void CleanupEventLists (void);
+ Deferred * AddToReadEvents (int Fd, h_msecs_t timeoutTime);
+ Deferred * AddToWriteEvents (int Fd, h_msecs_t timeoutTime);
+
+};
+
+#endif /* __HIPRO_ASYCXX__REACTOR_H__ */
Added: trunk/include/asycxx/RefCounter.h
===================================================================
--- trunk/include/asycxx/RefCounter.h (rev 0)
+++ trunk/include/asycxx/RefCounter.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,38 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__REF_COUNTER_H__
+#define __HIPRO_ASYCXX__REF_COUNTER_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include "asycxx.h"
+#include "Error.h"
+
+class RefCounter
+{
+public:
+ RefCounter ();
+
+ void Own (void);
+ void DisOwn (void);
+
+protected:
+ virtual ~RefCounter ();
+ int m__OwnerCount;
+};
+
+#endif /* __HIPRO_ASYCXX__REF_COUNTER_H__ */
Added: trunk/include/asycxx/SelectReactor.h
===================================================================
--- trunk/include/asycxx/SelectReactor.h (rev 0)
+++ trunk/include/asycxx/SelectReactor.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,51 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__SELECT_REACTOR_H__
+#define __HIPRO_ASYCXX__SELECT_REACTOR_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include <vector>
+
+#include <sys/select.h>
+
+#include "asycxx.h"
+#include "Reactor.h"
+
+class SelectReactor :public Reactor
+{
+
+public:
+ SelectReactor (void);
+ ~SelectReactor (void);
+
+protected:
+ void WaitForEvents (void);
+ void ProcessFDEvents (void);
+
+private:
+ int m_maxFd;
+ int m_FdCount;
+ fd_set m_FdsForReading;
+ bool m_bReadingFdSetIsEmpty;
+ fd_set m_FdsForWriting;
+ bool m_bWritingFdSetIsEmpty;
+
+ void BuildFdSets (void);
+};
+
+#endif /* __HIPRO_ASYCXX__SELECT_REACTOR_H__ */
Added: trunk/include/asycxx/TCPLLTransport.h
===================================================================
--- trunk/include/asycxx/TCPLLTransport.h (rev 0)
+++ trunk/include/asycxx/TCPLLTransport.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,37 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__TCP_LL_TRANSPORT_H__
+#define __HIPRO_ASYCXX__TCP_LL_TRANSPORT_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include "asycxx.h"
+#include "Reactor.h"
+#include "TCPTransport.h"
+
+class TCPLLTransport : public TCPTransport
+{
+public:
+ TCPLLTransport (Reactor *reactor, int fd);
+ virtual ~TCPLLTransport ();
+
+ void configureTCPLLNoDelay (void);
+ void configureTCPLLKeepAlive (int idle_time, int probe_count,
+ int probe_interval);
+};
+
+#endif /* __HIPRO_ASYCXX__TCP_LL_TRANSPORT_H__ */
Added: trunk/include/asycxx/TCPListener.h
===================================================================
--- trunk/include/asycxx/TCPListener.h (rev 0)
+++ trunk/include/asycxx/TCPListener.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,59 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__TCP_LISTENER_H__
+#define __HIPRO_ASYCXX__TCP_LISTENER_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include <sys/types.h>
+#include <arpa/inet.h>
+
+#include "asycxx.h"
+#include "Error.h"
+#include "Listener.h"
+#include "Factory.h"
+#include "Deferred.h"
+#include "Reactor.h"
+
+class TCPListener : public Listener
+{
+public:
+
+ TCPListener (Reactor *reactor, Factory *factory, unsigned short port);
+ TCPListener (Reactor *reactor, Factory *factory, char *ip,
+ unsigned short port);
+ virtual ~TCPListener ();
+
+ void SetupTCPNoDelay (void);
+
+protected:
+ Reactor *m_Reactor;
+ Factory *m_Factory;
+ Deferred *m_ReactorDeferred;
+
+ int m_Socket;
+ unsigned short m_BindPort;
+ in_addr m_BindIPAddr;
+ char m_BindAddr_str[64];
+ bool m_bSetupNoDelay;
+
+ void Init (Reactor *reactor, Factory *factory,
+ struct in_addr ip_addr, unsigned short port);
+ static void handleNewConnection (void *obj);
+};
+
+#endif /* __HIPRO_ASYCXX__TCP_LISTENER_H__ */
Added: trunk/include/asycxx/TCPTransport.h
===================================================================
--- trunk/include/asycxx/TCPTransport.h (rev 0)
+++ trunk/include/asycxx/TCPTransport.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,41 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C), 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__TCP_TRANSPORT_H__
+#define __HIPRO_ASYCXX__TCP_TRANSPORT_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include "asycxx.h"
+#include "Error.h"
+#include "Reactor.h"
+#include "DataBuffer.h"
+#include "Transport.h"
+
+class TCPTransport : public Transport
+{
+public:
+ TCPTransport (Reactor *reactor, int fd);
+ virtual ~TCPTransport ();
+
+protected:
+ Result doWrite (void);
+ Result doRead (DataBuffer *data);
+ void doDisconnect (void);
+
+};
+
+#endif /* __HIPRO_ASYCXX__TCP_TRANSPORT_H__ */
Added: trunk/include/asycxx/Timer.h
===================================================================
--- trunk/include/asycxx/Timer.h (rev 0)
+++ trunk/include/asycxx/Timer.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,87 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__TIMER_H__
+#define __HIPRO_ASYCXX__TIMER_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include <vector>
+
+#include "asycxx.h"
+#include "Reactor.h"
+
+
+/**
+ * \brief Timer's callback function type
+ *
+ * \param[in] obj The context-object to use for the callback
+ * \param[in] excess_time The number of milli-seconds elapsed after the
+ * configured timeout period. Consult the documentation of Timer for
+ * more information on this.
+ */
+typedef void (*cbTimerCallback_t)(void *obj, h_msecs_t excess_time);
+
+#define ASYCXX_TIMER_RESOLUTION 200
+
+class Timer
+{
+public:
+
+ /**
+ * \brief Timer type
+ *
+ * \detail The timer-type changes the behaviour of the
+ * timer. Consult the documentation of Timer class for more
+ * information.
+ */
+ enum TimerType
+ {
+ Timer_OneShot, /**< A one-shot timer. Fires only once */
+ Timer_Periodic, /**< A periodic timer. Fires periodically */
+ };
+
+ static void Init (Reactor *reactor);
+ static void UpdateTimers (h_timestamp_t currentTS);
+
+ Timer (h_msecs_t timeoutTime, TimerType type,
+ cbTimerCallback_t cb_fn, void * cb_obj);
+ ~Timer ();
+ void StartTimer (void);
+ void StopTimer (void);
+
+private:
+ static Reactor *m_Reactor;
+ static std::vector<Timer *> m_Timers;
+ static h_timestamp_t m_LastUpdatedTS;
+ static Deferred *m_ReactorDeferred;
+ static void RegisterTimer (Timer *timer);
+ static void UnRegisterTimer (Timer *timer);
+ static void CheckAndFireTimers (void *obj, h_msecs_t excess_time);
+
+ enum TimerType m_Type;
+ bool m_bTimerActive;
+
+ h_msecs_t m_TimeoutTime;
+ h_timestamp_t m_LastTriggerTS;
+ h_timestamp_t m_NextTriggerTS;
+
+ cbTimerCallback_t m_cbFunction;
+ void * m_cbObject;
+};
+
+
+#endif /* __HIPRO_ASYCXX__TIMER_H__ */
Added: trunk/include/asycxx/Transport.h
===================================================================
--- trunk/include/asycxx/Transport.h (rev 0)
+++ trunk/include/asycxx/Transport.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,82 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi....
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ASYCXX__TRANSPORT_H__
+#define __HIPRO_ASYCXX__TRANSPORT_H__
+
+#ifdef HAVE_CONFIG_H
+#include <asycxx-config.h>
+#endif
+
+#include <deque>
+
+#include "asycxx.h"
+#include "Error.h"
+#include "Reactor.h"
+#include "DataBuffer.h"
+
+class Protocol;
+
+#define ASYCXX_TRANSPORT_DEFAULT_READ_BUFSIZE 1024
+class Transport
+{
+
+public:
+ Transport (Reactor *reactor, int fd);
+ virtual ~Transport ();
+
+ /* method to write to the transport */
+ void Write (DataBuffer *data);
+ /* method to disconnect the transport and mark for destruction */
+ void LoseConnection (void);
+
+ /* methods to configure the transport */
+ void configureReadTimeout (h_msecs_t timeout);
+ void configureWriteTimeout (h_msecs_t timeout);
+ void configureReadBufferSize (size_t len);
+
+ /* accessors */
+ int FD (void) { return m_Fd; }
+ Protocol * GetProtocol (void);
+ void SetProtocol (Protocol *protocol);
+
+protected:
+ Reactor *m_Reactor;
+ Protocol *m_Protocol;
+ int m_Fd;
+
+ size_t m_readBufSize;
+ h_msecs_t m_writeTimeout; /* the timeout used for reading */
+ Deferred *m_readDefer; /* deferred to handle reading */
+ Deferred *m_writeDefer; /* deferred to handle writing */
+ std::deque<DataBuffer *> m_writeBuffers;
+ bool m_bDisconnectAndDie;
+
+ /* methods to be implemented by the derived sub-classes */
+ virtual Result doWrite (void) = 0;
+ virtual Result doRead (DataBuffer *data) = 0;
+ virtual void doDisconnect (void) = 0;
+
+ /* handler methods */
+ static void handleReadable (void *obj);
+ static void handleReadTimeout (void *obj, h_msecs_t excess_time);
+ static void handleWritable (void *obj);
+ static void handleWriteTimeout (void *obj, h_msecs_t excess_time);
+
+private:
+ void KillMeIfYouMust (void);
+
+};
+
+#endif /* __HIPRO_ASYCXX__TRANSPORT_H__ */
Added: trunk/include/asycxx/XMLParser.h
===================================================================
--- trunk/include/asycxx/XMLParser.h (rev 0)
+++ trunk/include/asycxx/XMLParser.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,46 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+/********************************************************************
+ * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
+ * rights reserved.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms described in the LICENSE file which accompanies
+ * this distribution. If the LICENSE file was not attached to this
+ * distribution or for further clarifications, please contact
+ * le...@hi...
+ *
+ *******************************************************************/
+
+#ifndef __HIPRO_ACW__XML_PARSER_H__
+#define __HIPRO_ACW__XML_PARSER_H__
+
+#include <vector>
+#include <hdb-tinyxml/tinyxml.h>
+
+#include "asycxx.h"
+
+class XMLParser
+{
+public:
+ XMLParser (const char *file_name);
+ ~XMLParser ();
+
+ Result GetValue (const char *xpath, const char **value);
+ Result GetValue (const char *xpath, int *value);
+
+protected:
+ char m_FileName[HMI_CTRL_MAX_URL_LEN];
+ TiXmlDocument *m_txDoc;
+
+private:
+
+ Result ParseXPath (const char *xpath);
+
+ /* used by the xpath parser */
+ char m_XPath[HMI_CTRL_MAX_XPATH_LEN];
+ std::vector<char *> m_XPathComponents;
+
+};
+
+#endif /* __ACW__XML_PARSER_H__ */
Added: trunk/include/asycxx/asycxx.h
===================================================================
--- trunk/include/asycxx/asycxx.h (rev 0)
+++ trunk/include/asycxx/asycxx.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -0,0 +1,71 @@
+/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
+
+#ifndef __ACW__HMI_CTRL_H__
+#define __ACW__HMI_CTRL_H__
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "Logger.h"
+
+extern Logger *Log;
+
+#define cERR(fmt, ...) fprintf (stderr, "[E:%18s:%04d] " fmt "\n", \
+ __FILE__, __LINE__, ##__VA_ARGS__)
+#define ERR(fmt, ...) Log->LogThis ("[%20s:%04d] ERROR: " fmt "\n", \
+ __FILE__, __LINE__, ##__VA_ARGS__)
+#define LOG(fmt, ...) Log->LogThis ("[%20s:%04d] " fmt "\n", \
+ __FILE__, __LINE__, ##__VA_ARGS__)
+
+/* log messages to track ctor and dtor */
+#define ctorLOG(cls) Log->LogThis ("CTOR: %s <%p>\n", cls, this)
+#define dtorLOG(cls) Log->LogThis ("DTOR: %s <%p>\n", cls, this)
+
+#define dummyLog(fmt, ...)
+
+#if HMI_CTRL_VERBOSE_LEVEL >= 1
+#define LOG1 LOG
+#else
+#define LOG1 dummyLog
+#endif
+
+#if HMI_CTRL_VERBOSE_LEVEL >= 2
+#define LOG2 LOG
+#else
+#define LOG2 dummyLog
+#endif
+
+#if HMI_CTRL_VERBOSE_LEVEL >= 3
+#define LOG3 LOG
+#else
+#define LOG3 dummyLog
+#endif
+
+#define ASSERT(x, fmt, ...) \
+ { \
+ if (!(x)) \
+ { \
+ THROW (DevError, "assertion failed: %s, " fmt "\n", \
+ #x, ##__VA_ARGS__); \
+ } \
+ }
+
+enum Result
+ {
+ Result_Success = 0,
+ Result_Error,
+ Result_Pending,
+ Result_NotFound,
+ };
+
+typedef unsigned char u8_t;
+typedef long long h_msecs_t;
+typedef long long h_timestamp_t;
+
+h_msecs_t GetCurrentTimeStamp (void);
+void SetFDAsNonBlocking (int fd);
+
+#define HMI_CTRL_MAX_URL_LEN 512
+#define HMI_CTRL_MAX_XPATH_LEN 1024
+
+#endif /* __ACW__HMI_CTRL_H__ */
Deleted: trunk/src/App.cxx
===================================================================
--- trunk/src/App.cxx 2009-02-05 20:57:10 UTC (rev 3)
+++ trunk/src/App.cxx 2009-02-20 18:58:54 UTC (rev 4)
@@ -1,113 +0,0 @@
-/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
-
-/********************************************************************
- * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
- * rights reserved.
- *
- * This program and the accompanying materials are made available
- * under the terms described in the LICENSE file which accompanies
- * this distribution. If the LICENSE file was not attached to this
- * distribution or for further clarifications, please contact
- * le...@hi....
- *
- *******************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
-#endif
-
-#include <string.h>
-#include <errno.h>
-
-#include "hmi-ctrl.h"
-#include "App.h"
-#include "Config.h"
-#include "SpindleManager.h"
-
-
-App* App::m_App = NULL;
-
-/**
- * \brief Method to get the App object
- *
- * \details This is a static method which should be used to get the
- * App object. More information on the App class is provided in the
- * class documentation.
- */
-App*
-App::GetApp (void)
-{
- if (m_App == NULL)
- {
- m_App = new App();
- }
- return m_App;
-}
-
-
-/**
- * \brief constructor
- */
-App::App ()
-{
- m_Config = NULL;
-}
-
-
-/**
- * \brief destructor
- */
-App::~App ()
-{
- if (m_Config != NULL)
- {
- delete m_Config;
- }
-
- if (m_SpindleManager != NULL)
- {
- delete m_SpindleManager;
- }
-}
-
-
-/**
- * \brief Initialize the App
- *
- * \param[in] config_file The configuration file to use
- *
- * \details This method initializes the App object. This should be
- * called only once. When called the second time, this method will
- * return a Result_Error.
- */
-Result
-App::Init (const char *config_file)
-{
- /* Load and initialize the configuration file */
- m_Config = new Config(config_file);
-
- /* Load the Spindle-manager */
- m_SpindleManager = new SpindleManager ();
-
- /* TBD: Load the Doffer-manager */
-
- /* TBD: Load the HStock-manager */
-
- return Result_Success;
-}
-
-
-Config*
-App::GetConfig (void)
-{
- ASSERT ((m_Config != NULL), "cannot get Config before ::Init");
- return m_Config;
-}
-
-SpindleManager*
-App::GetSpindleManager (void)
-{
- ASSERT ((m_SpindleManager != NULL),
- "cannot get SpindleManager before ::Init");
- return m_SpindleManager;
-}
Deleted: trunk/src/App.h
===================================================================
--- trunk/src/App.h 2009-02-05 20:57:10 UTC (rev 3)
+++ trunk/src/App.h 2009-02-20 18:58:54 UTC (rev 4)
@@ -1,47 +0,0 @@
-/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
-
-/********************************************************************
- * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
- * rights reserved.
- *
- * This program and the accompanying materials are made available
- * under the terms described in the LICENSE file which accompanies
- * this distribution. If the LICENSE file was not attached to this
- * distribution or for further clarifications, please contact
- * le...@hi....
- *
- *******************************************************************/
-
-#ifndef __HIPRO_ACW__APP_H__
-#define __HIPRO_ACW__APP_H__
-
-#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
-#endif
-
-#include "hmi-ctrl.h"
-#include "Config.h"
-
-class SpindleManager;
-
-class App
-{
-public:
- ~App ();
-
- static App* GetApp (void);
- Result Init (const char *config_file);
-
- Config* GetConfig (void);
- SpindleManager* GetSpindleManager (void);
-
-private:
- App ();
-
- static App *m_App;
- Config *m_Config;
- SpindleManager *m_SpindleManager;
-
-};
-
-#endif
Deleted: trunk/src/Config.cxx
===================================================================
--- trunk/src/Config.cxx 2009-02-05 20:57:10 UTC (rev 3)
+++ trunk/src/Config.cxx 2009-02-20 18:58:54 UTC (rev 4)
@@ -1,217 +0,0 @@
-/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; -*- */
-
-/********************************************************************
- * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All
- * rights reserved.
- *
- * This program and the accompanying materials are made available
- * under the terms described in the LICENSE file which accompanies
- * this distribution. If the LICENSE file was not attached to this
- * distribution or for further clarifications, please contact
- * le...@hi...
- *
- *******************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
-#endif
-
-#include "hmi-ctrl.h"
-#include "Config.h"
-#include "Error.h"
-
-
-/**
- * \brief constructor
- */
-Config::Config (const char *file_name) :
- XMLParser (file_name)
-{
- memset ((void *)&m_SpindleIp, 0, CONFIG_IP_LEN);
- memset ((void *)&m_DofferIp, 0, CONFIG_IP_LEN);
- memset ((void *)&m_HStockIp, 0, CONFIG_IP_LEN);
- m_SpindlePort = 10000;
- m_DofferPort = 10001;
- m_HStockPort = 10002;
-
- memset ((void *)&m_LocalRPCIp, 0, CONFIG_IP_LEN);
- memset ((void *)&m_PublicRPCIp, 0, CONFIG_IP_LEN);
- m_LocalRPCPort = 10010;
- m_PublicRPCPort = 10011;
-}
-
-
-/**
- * \brief destructor
- */
-Config::~Config ()
-{
-
-}
-
-
-const int
-Config::GetSpindleCount (void)
-{
- int value;
- Result ret;
-
- ret = GetValue ("/hmi-ctrl-config/spindle-count", &value);
- if (ret != Result_Success)
- {
- ERR ("failed to get /hmi-ctrl-config/spindle-count. Bad config-file?");
- return 0;
- }
- if (value <= 0)
- {
- THROW (RunTimeError,
- "/hmi-ctrl-config/spindle-count should be greater than 0");
- }
-
- return value;
-}
-
-
-void
-Config::GetSpindleNetCfg (char **Ip, int *Port)
-{
- Result ret;
-
- const char *ip;
- int port;
-
- ret = GetValue ("/hmi-ctrl-config/spindle-ctrl/ip", &ip);
- if (ret != Result_Success)
- {
- ERR ("failed to get /hmi-ctrl-config/spindle-ctrl/ip. "
- "Assuming default");
- strcpy (m_SpindleIp, "0.0.0.0");
- }
-
- ret = GetValue ("/hmi-ctrl-config/spindle-ctrl/port", &port);
- if (ret != Result_Success)
- {
- ERR ("failed to get /hmi-ctrl-config/spindle-ctrl/port. "
- "Assuming default");
- m_SpindlePort = 10000;
- }
-
- *Port = m_SpindlePort;
- *Ip = m_SpindleIp;
-}
-
-
-void
-Config::GetDofferNetCfg (char **Ip, int *Port)
-{
- Result ret;
-
- const char *ip;
- int port;
-
- ret = GetValue ("/hmi-ctrl-config/doffer-ctrl/ip", &ip);
- if (ret != Result_Success)
- {
- ERR ("failed to get /hmi-ctrl-config/doffer-ctrl/ip. "
- "Assuming default");
- strcpy (m_DofferIp, "0.0.0.0");
- }
-
- ret = GetValue ("/hmi-ctrl-config/doffer-ctrl/port", &port);
- if (ret != Result_Success)
- {
- ERR ("failed to get /hmi-ctrl-config/doffer-ctrl/port. "
- "Assuming default");
- m_DofferPort = 10001;
- }
-
- *Port = m_DofferPort;
- *Ip = m_DofferIp;
-}
-
-
-void
-Config::GetHStockNetCfg (char **Ip, int *Port)
-{
- Result ret;
-
- const char *ip;
- int port;
-
- ret = GetValue ("/hmi-ctrl-config/hstock-ctrl/ip", &ip);
- if (ret != Result_Success)
- {
- ERR ("failed to get /hmi-ctrl-config/hstock-ctrl/ip. "
- "Assuming default");
- strcpy (m_HStockIp, "0.0.0.0");
- }
-
- ret = GetValue ("/hmi-ctrl-config/hstock-ctrl/port", &port);
- if (ret != Result_Success)
- {
- ERR ("fa...
[truncated message content] |
|
From: js <js...@hi...> - 2009-02-20 18:21:28
|
On Thu, 2009-02-19 at 22:56 +0530, Karthik Balakrishnan wrote: > Patch file attached. > > I retained the configure.ac 's 'setup a release tag'. I thought it > might be useful. Though i am not sure of it. Comments please Seems fine. Please commit it. -- Joe Steeve HiPro IT Solutions Pvt. Ltd. http://hipro.co.in/ |
|
From: Karthik B. <ka...@hi...> - 2009-02-19 17:26:52
|
Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac (revision 3)
+++ trunk/configure.ac (working copy)
@@ -1,6 +1,8 @@
-AC_INIT([hmi-ctrl], [0.1], jo...@hi...)
+AC_INIT([asycxx], [0.1], jo...@hi...)
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
+AC_PREFIX_DEFAULT(/opt/asycxx)
+
CFLAGS="-Wall -Werror"
CXXFLAGS="-Wall -Werror"
@@ -8,59 +10,49 @@
AC_ARG_WITH(verbose-level,
AS_HELP_STRING([--with-verbose-level],
[Use the given debug level (0 to 3) 0=disable]),
- [hmi_ctrl_with_verbose_level=$withval],)
+ [asycxx_with_verbose_level=$withval],)
-if test $hmi_ctrl_with_verbose_level; then
- HMI_CTRL_verbose_level=$hmi_ctrl_with_verbose_level
+if test $asycxx_with_verbose_level; then
+ ASYCXX_verbose_level=$asycxx_with_verbose_level
else
- HMI_CTRL_verbose_level=2
+ ASYCXX_verbose_level=2
fi
-AC_DEFINE_UNQUOTED(HMI_CTRL_VERBOSE_LEVEL, $HMI_CTRL_verbose_level,
+AC_DEFINE_UNQUOTED(ASYCXX_VERBOSE_LEVEL, $ASYCXX_verbose_level,
[Controls the amount of logs])
dnl SCM revision tag
-HMI_CTRL_revision=`svn info | grep "^Revision" | cut -d' ' -f 2 -s`
-if [[ "$HMI_CTRL_revision" = "" ]]; then
- HMI_CTRL_revision="unknown"
+ASYCXX_revision=`svn info | grep "^Revision" | cut -d' ' -f 2 -s`
+if [[ "$ASYCXX_revision" = "" ]]; then
+ ASYCXX_revision="unknown"
fi
-AC_DEFINE_UNQUOTED(HMI_CTRL_REVISION, "$HMI_CTRL_revision",
+AC_DEFINE_UNQUOTED(ASYCXX_REVISION, "$ASYCXX_revision",
[SCM revision number])
dnl setup a release tag
AC_ARG_WITH(release-tag,
AS_HELP_STRING([--with-release-tag],
[Release tag to associate with the build]),
- [HMI_CTRL_release_tag=$withval],)
+ [ASYCXX_release_tag=$withval],)
-if test -z $HMI_CTRL_release_tag; then
- HMI_CTRL_release_tag="<DEBUG:Rev=$HMI_CTRL_revision>"
+if test -z $ASYCXX_release_tag; then
+ ASYCXX_release_tag="<DEBUG:Rev=$ASYCXX_revision>"
fi
-AC_DEFINE_UNQUOTED(HMI_CTRL_RELEASE_TAG, "$HMI_CTRL_release_tag",
+AC_DEFINE_UNQUOTED(ASYCXX_RELEASE_TAG, "$ASYCXX_release_tag",
[Release tag associated with the build])
-
-dnl setup the acw-common
-ACW_COMMON_Folder=`pwd`/../acw-common
-CFLAGS="$CFLAGS -I $ACW_COMMON_Folder"
-CXXFLAGS="$CXXFLAGS -I $ACW_COMMON_Folder"
-dnl setup the hmi-common
-HMI_COMMON_Folder=`pwd`/../hmi-common
-CFLAGS="$CFLAGS -I $HMI_COMMON_Folder"
-CXXFLAGS="$CXXFLAGS -I $HMI_COMMON_Folder"
-
dnl enable/disable sanity checks
AC_ARG_ENABLE(sanity-checks,
AS_HELP_STRING([--enable-sanity-checks],
[Enable all sanity checks]),
[
if [[ "$enableval" = "yes" ]]; then
- HMI_CTRL_sanity_checks=1
+ ASYCXX_sanity_checks=1
else
- HMI_CTRL_sanity_checks=0
+ ASYCXX_sanity_checks=0
fi
],
- [HMI_CTRL_sanity_checks=1])
-AC_DEFINE_UNQUOTED(ENABLE_SANITY_CHECKS, $HMI_CTRL_sanity_checks,
+ [ASYCXX_sanity_checks=1])
+AC_DEFINE_UNQUOTED(ENABLE_SANITY_CHECKS, $ASYCXX_sanity_checks,
[Enable/Disable sanity checks])
dnl check for libhdb-tinyxml
@@ -74,10 +66,33 @@
AC_PROG_CXX
AC_GNU_SOURCE
+AC_PROG_LIBTOOL
-AC_CONFIG_HEADERS([hmi-ctrl-config.h])
+AC_CONFIG_HEADERS([asycxx-config.h])
AC_CONFIG_FILES([
Makefile
src/Makefile
+include/Makefile
+asycxx-0.1.pc
])
+AC_CONFIG_LINKS(src/Logger.h:include/asycxx/Logger.h
+ src/Error.h:include/asycxx/Error.h
+ src/Deferred.h:include/asycxx/Deferred.h
+ src/RefCounter.h:include/asycxx/RefCounter.h
+ src/DataBuffer.h:include/asycxx/DataBuffer.h
+ src/Reactor.h:include/asycxx/Reactor.h
+ src/SelectReactor.h:include/asycxx/SelectReactor.h
+ src/Timer.h:include/asycxx/Timer.h
+ src/Transport.h:include/asycxx/Transport.h
+ src/Listener.h:include/asycxx/Listener.h
+ src/TCPTransport.h:include/asycxx/TCPTransport.h
+ src/TCPListener.h:include/asycxx/TCPListener.h
+ src/TCPLLTransport.h:include/asycxx/TCPLLTransport.h
+ src/Protocol.h:include/asycxx/Protocol.h
+ src/Factory.h:include/asycxx/Factory.h
+ src/MsgBus.h:include/asycxx/MsgBus.h
+ src/MsgHandler.h:include/asycxx/MsgHandler.h
+ src/GimpleMsgBus.h:include/asycxx/GimpleMsgBus.h
+ src/XMLParser.h:include/asycxx/XMLParser.h
+ src/asycxx.h:include/asycxx/asycxx.h)
AC_OUTPUT
Index: trunk/src/Deferred.cxx
===================================================================
--- trunk/src/Deferred.cxx (revision 3)
+++ trunk/src/Deferred.cxx (working copy)
@@ -13,14 +13,14 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <stdlib.h>
#include <errno.h>
#include <string.h>
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
#include "Deferred.h"
Index: trunk/src/Timer.cxx
===================================================================
--- trunk/src/Timer.cxx (revision 3)
+++ trunk/src/Timer.cxx (working copy)
@@ -39,12 +39,12 @@
*/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <vector>
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
#include "Timer.h"
Index: trunk/src/core.cxx
===================================================================
--- trunk/src/core.cxx (revision 3)
+++ trunk/src/core.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <sys/time.h>
@@ -22,7 +22,7 @@
#include <unistd.h>
#include <fcntl.h>
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
h_msecs_t
Index: trunk/src/TCPLLTransport.cxx
===================================================================
--- trunk/src/TCPLLTransport.cxx (revision 3)
+++ trunk/src/TCPLLTransport.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <errno.h>
@@ -23,7 +23,7 @@
#include <netinet/in.h>
#include <netinet/tcp.h>
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
#include "Protocol.h"
#include "TCPLLTransport.h"
Index: trunk/src/Transport.cxx
===================================================================
--- trunk/src/Transport.cxx (revision 3)
+++ trunk/src/Transport.cxx (working copy)
@@ -13,12 +13,12 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <unistd.h>
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
#include "Transport.h"
#include "Protocol.h"
Index: trunk/src/GimpleMsgBus.cxx
===================================================================
--- trunk/src/GimpleMsgBus.cxx (revision 3)
+++ trunk/src/GimpleMsgBus.cxx (working copy)
@@ -11,13 +11,13 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <string.h>
#include <arpa/inet.h>
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
#include "Transport.h"
Index: trunk/src/SelectReactor.cxx
===================================================================
--- trunk/src/SelectReactor.cxx (revision 3)
+++ trunk/src/SelectReactor.cxx (working copy)
@@ -13,14 +13,14 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <sys/select.h>
#include <errno.h>
#include <string.h>
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
#include "SelectReactor.h"
Index: trunk/src/XMLParser.cxx
===================================================================
--- trunk/src/XMLParser.cxx (revision 3)
+++ trunk/src/XMLParser.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <stdio.h>
@@ -21,7 +21,7 @@
#include <errno.h>
#include "XMLParser.h"
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
#include <hdb-tinyxml/tinyxml.h>
Index: trunk/src/Logger.cxx
===================================================================
--- trunk/src/Logger.cxx (revision 3)
+++ trunk/src/Logger.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <stdio.h>
Index: trunk/src/MsgHandler.cxx
===================================================================
--- trunk/src/MsgHandler.cxx (revision 3)
+++ trunk/src/MsgHandler.cxx (working copy)
@@ -11,10 +11,10 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
#include "MsgHandler.h"
Index: trunk/src/Listener.cxx
===================================================================
--- trunk/src/Listener.cxx (revision 3)
+++ trunk/src/Listener.cxx (working copy)
@@ -13,11 +13,11 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
#include "Listener.h"
Index: trunk/src/Error.cxx
===================================================================
--- trunk/src/Error.cxx (revision 3)
+++ trunk/src/Error.cxx (working copy)
@@ -13,14 +13,14 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <execinfo.h>
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
void
Index: trunk/src/TCPListener.cxx
===================================================================
--- trunk/src/TCPListener.cxx (revision 3)
+++ trunk/src/TCPListener.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <sys/types.h>
@@ -26,7 +26,7 @@
#include <errno.h>
#include <unistd.h>
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
#include "Factory.h"
#include "Protocol.h"
Index: trunk/src/Reactor.cxx
===================================================================
--- trunk/src/Reactor.cxx (revision 3)
+++ trunk/src/Reactor.cxx (working copy)
@@ -21,13 +21,13 @@
*/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <unistd.h>
#include <exception>
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Reactor.h"
#include "Deferred.h"
Index: trunk/src/MsgBus.cxx
===================================================================
--- trunk/src/MsgBus.cxx (revision 3)
+++ trunk/src/MsgBus.cxx (working copy)
@@ -11,10 +11,10 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
#include "MsgBus.h"
#include "MsgHandler.h"
Index: trunk/src/Protocol.cxx
===================================================================
--- trunk/src/Protocol.cxx (revision 3)
+++ trunk/src/Protocol.cxx (working copy)
@@ -13,11 +13,11 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
#include "Protocol.h"
Index: trunk/src/DataBuffer.cxx
===================================================================
--- trunk/src/DataBuffer.cxx (revision 3)
+++ trunk/src/DataBuffer.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include "DataBuffer.h"
Index: trunk/src/TCPTransport.cxx
===================================================================
--- trunk/src/TCPTransport.cxx (revision 3)
+++ trunk/src/TCPTransport.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <errno.h>
@@ -24,7 +24,7 @@
#include <sys/socket.h>
#include <errno.h>
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
#include "Protocol.h"
#include "TCPTransport.h"
Index: trunk/src/Factory.cxx
===================================================================
--- trunk/src/Factory.cxx (revision 3)
+++ trunk/src/Factory.cxx (working copy)
@@ -13,11 +13,11 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
#include "Reactor.h"
#include "Factory.h"
Index: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am (revision 3)
+++ trunk/src/Makefile.am (working copy)
@@ -1,40 +1,28 @@
# -*- mode: makefile; indent-tabs-mode: nil; tab-width: 4; -*-
-AM_LDFLAGS = -lpthread $(HDB_TINYXML_LIBS) -rdynamic
-AM_CXXFLAGS = \
- -DHMI_CTRL_CONFIGDIR=\"$(sysconfdir)/hmi-ctrl/\" \
- -DHMI_CTRL_DATADIR=\"$(pkgdatadir)/data/\" \
- $(HDB_TINYXML_CFLAGS)
+lib_LTLIBRARIES = libasycxx-0.1.la
-
-bin_PROGRAMS = hmi-ctrl hmi-ctrl.debug
-
-hmi_ctrl_SOURCES = \
- Logger.cxx Logger.h \
- Error.cxx Error.h \
- Deferred.cxx Deferred.h \
- RefCounter.cxx RefCounter.h \
- DataBuffer.cxx DataBuffer.h \
- Reactor.cxx Reactor.h \
- SelectReactor.cxx SelectReactor.h \
- Timer.cxx Timer.h \
- Transport.cxx Transport.h \
- Listener.cxx Listener.h \
- TCPTransport.cxx TCPTransport.h \
- TCPListener.cxx TCPListener.h \
- TCPLLTransport.cxx TCPLLTransport.h \
- Protocol.cxx Protocol.h \
- Factory.cxx Factory.h \
- MsgBus.cxx MsgBus.h \
- MsgHandler.cxx MsgHandler.h \
- GimpleMsgBus.cxx GimpleMsgBus.h \
- XMLParser.cxx XMLParser.h \
- Config.cxx Config.h \
- App.cxx App.h \
- hmi-ctrl.cxx hmi-ctrl.h \
+libasycxx_0_1_la_SOURCES = \
+ Logger.cxx \
+ Error.cxx \
+ Deferred.cxx.h \
+ RefCounter.cxx \
+ DataBuffer.cxx \
+ Reactor.cxx \
+ SelectReactor.cxx \
+ Timer.cxx \
+ Transport.cxx \
+ Listener.cxx \
+ TCPTransport.cxx \
+ TCPListener.cxx \
+ TCPLLTransport.cxx \
+ Protocol.cxx \
+ Factory.cxx \
+ MsgBus.cxx \
+ MsgHandler.cxx \
+ GimpleMsgBus.cxx \
+ XMLParser.cxx \
core.cxx
-hmi_ctrl_CXXFLAGS = -O2 $(AM_CXXFLAGS)
-
-hmi_ctrl_debug_SOURCES = $(hmi_ctrl_SOURCES)
-hmi_ctrl_debug_CXXFLAGS = -g $(AM_CXXFLAGS)
+libasycxx_0_1_la_CXXFLAGS = -O2 $(HDB_TINYXML_CFLAGS)
+libasycxx_0_1_la_LDFLAGS = -version-info 0:1:0
Index: trunk/src/RefCounter.cxx
===================================================================
--- trunk/src/RefCounter.cxx (revision 3)
+++ trunk/src/RefCounter.cxx (working copy)
@@ -13,10 +13,10 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx.h"
#include "Error.h"
#include "RefCounter.h"
Index: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am (revision 3)
+++ trunk/Makefile.am (working copy)
@@ -1,5 +1,5 @@
# -*- mode: makefile; indent-tabs-mode: nil; tab-width: 4; -*-
-configdir = $(sysconfdir)/hmi-ctrl
-dist_config_DATA = hmi-ctrl-config.xml.sample
+SUBDIRS = src include
-SUBDIRS = src
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = asycxx-0.1.pc
Index: trunk/autogen.sh
===================================================================
--- trunk/autogen.sh (revision 3)
+++ trunk/autogen.sh (working copy)
@@ -2,5 +2,6 @@
echo "Generating build necessaries..."
aclocal
+libtoolize --force
automake --add-missing
autoconf |
|
From: Karthik B. <ka...@hi...> - 2009-02-18 08:27:05
|
On Wed, Feb 18, 2009 at 11:31 AM, Joe Steeve <js...@hi...> wrote: > Yeah, actually that would be better. We can get the things we need back > after the basic library gets to shape. > The macros ... are asycxx specific. > I'll resend the patch this evening with the changes. Sorry on the delay.. -- Karthik HiPro IT Solutions Pvt. Ltd. http://hipro.co.in/ |
|
From: Joe S. <js...@hi...> - 2009-02-18 06:02:08
|
Karthik Balakrishnan wrote: > All that needs to stay will be added again including the library versioning > thing. Yeah, actually that would be better. We can get the things we need back after the basic library gets to shape. > This is an internal header. This need not be put in a > separate folder and installed while installing the dev > files. > The macros in asycxx.h might be useful.. Are you sure you > don't want this file to be available for development? The macros in that file are controlled by the configure command line. It basically controls the level of logs generated by the library. So, those macros are irrelevant to an application that is using the library. The application should be defining such macros in its code base. The application can probably use the asycxx library's logger. However, those convenience macros are asycxx specific. -- Joe Steeve HiPro IT Solutions Pvt. Ltd. http://hipro.co.in/ |
|
From: Karthik B. <ka...@hi...> - 2009-02-17 17:02:23
|
On Tue, Feb 17, 2009 at 4:15 PM, Joe Steeve <js...@hi...> wrote: > ... This needs to stay. All that needs to stay will be added again including the library versioning thing. > call this header as "asycxx.h". changes will be done. > This is an internal header. This need not be put in a separate folder and installed while installing the dev > files. The macros in asycxx.h might be useful.. Are you sure you don't want this file to be available for development? > Hmm. Does 'make install' install the headers and the .la file also? > Yups. It does install both -- Karthik HiPro IT Solutions Pvt. Ltd. http://hipro.co.in/ |
|
From: Joe S. <js...@hi...> - 2009-02-17 10:45:53
|
Karthik Balakrishnan wrote: > .. > -dnl setup the debug level > -AC_ARG_WITH(verbose-level, > - AS_HELP_STRING([--with-verbose-level], > - [Use the given debug level (0 to 3) 0=disable]), > - [hmi_ctrl_with_verbose_level=$withval],) > - > -if test $hmi_ctrl_with_verbose_level; then > - HMI_CTRL_verbose_level=$hmi_ctrl_with_verbose_level > -else > - HMI_CTRL_verbose_level=2 > -fi > -AC_DEFINE_UNQUOTED(HMI_CTRL_VERBOSE_LEVEL, $HMI_CTRL_verbose_level, > - [Controls the amount of logs]) This configuration option controls what LOGs are getting printed on the console. This needs to stay. > -dnl setup a release tag > -AC_ARG_WITH(release-tag, > - AS_HELP_STRING([--with-release-tag], > - [Release tag to associate with the build]), > - [HMI_CTRL_release_tag=$withval],) > - > -if test -z $HMI_CTRL_release_tag; then > - HMI_CTRL_release_tag="<DEBUG:Rev=$HMI_CTRL_revision>" > -fi > -AC_DEFINE_UNQUOTED(HMI_CTRL_RELEASE_TAG, "$HMI_CTRL_release_tag", > - [Release tag associated with the build]) We might need this for library versioning. But for now I guess we can simply ignore it. > -dnl enable/disable sanity checks > -AC_ARG_ENABLE(sanity-checks, > - AS_HELP_STRING([--enable-sanity-checks], > - [Enable all sanity checks]), > - [ > - if [[ "$enableval" = "yes" ]]; then > - HMI_CTRL_sanity_checks=1 > - else > - HMI_CTRL_sanity_checks=0 > - fi > - ], > - [HMI_CTRL_sanity_checks=1]) > -AC_DEFINE_UNQUOTED(ENABLE_SANITY_CHECKS, $HMI_CTRL_sanity_checks, > - [Enable/Disable sanity checks]) I remember putting some checks inside the code based on this macro. These checks are there for debugging. This needs to stay. > -#include "hmi-ctrl.h" > +#include "asycxx-log.h" call this header as "asycxx.h". This is an internal header. This need not be put in a separate folder and installed while installing the dev files. > Index: trunk/Makefile.am > =================================================================== > --- trunk/Makefile.am (revision 3) > +++ trunk/Makefile.am (working copy) > @@ -1,5 +1,5 @@ > # -*- mode: makefile; indent-tabs-mode: nil; tab-width: 4; -*- > -configdir = $(sysconfdir)/hmi-ctrl > -dist_config_DATA = hmi-ctrl-config.xml.sample > +SUBDIRS = src include > > -SUBDIRS = src > +pkgconfigdir = $(libdir)/pkgconfig > +pkgconfig_DATA = asycxx-0.1.pc > Index: trunk/autogen.sh Hmm. Does 'make install' install the headers and the .la file also? -- Joe Steeve HiPro IT Solutions Pvt. Ltd. http://hipro.co.in/ |
|
From: Karthik B. <ka...@hi...> - 2009-02-16 14:32:16
|
Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac (revision 3)
+++ trunk/configure.ac (working copy)
@@ -1,68 +1,11 @@
-AC_INIT([hmi-ctrl], [0.1], jo...@hi...)
+AC_INIT([asycxx], [0.1], jo...@hi...)
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
+AC_PREFIX_DEFAULT(/opt/asycxx)
+
CFLAGS="-Wall -Werror"
CXXFLAGS="-Wall -Werror"
-dnl setup the debug level
-AC_ARG_WITH(verbose-level,
- AS_HELP_STRING([--with-verbose-level],
- [Use the given debug level (0 to 3) 0=disable]),
- [hmi_ctrl_with_verbose_level=$withval],)
-
-if test $hmi_ctrl_with_verbose_level; then
- HMI_CTRL_verbose_level=$hmi_ctrl_with_verbose_level
-else
- HMI_CTRL_verbose_level=2
-fi
-AC_DEFINE_UNQUOTED(HMI_CTRL_VERBOSE_LEVEL, $HMI_CTRL_verbose_level,
- [Controls the amount of logs])
-
-dnl SCM revision tag
-HMI_CTRL_revision=`svn info | grep "^Revision" | cut -d' ' -f 2 -s`
-if [[ "$HMI_CTRL_revision" = "" ]]; then
- HMI_CTRL_revision="unknown"
-fi
-AC_DEFINE_UNQUOTED(HMI_CTRL_REVISION, "$HMI_CTRL_revision",
- [SCM revision number])
-
-dnl setup a release tag
-AC_ARG_WITH(release-tag,
- AS_HELP_STRING([--with-release-tag],
- [Release tag to associate with the build]),
- [HMI_CTRL_release_tag=$withval],)
-
-if test -z $HMI_CTRL_release_tag; then
- HMI_CTRL_release_tag="<DEBUG:Rev=$HMI_CTRL_revision>"
-fi
-AC_DEFINE_UNQUOTED(HMI_CTRL_RELEASE_TAG, "$HMI_CTRL_release_tag",
- [Release tag associated with the build])
-
-
-dnl setup the acw-common
-ACW_COMMON_Folder=`pwd`/../acw-common
-CFLAGS="$CFLAGS -I $ACW_COMMON_Folder"
-CXXFLAGS="$CXXFLAGS -I $ACW_COMMON_Folder"
-dnl setup the hmi-common
-HMI_COMMON_Folder=`pwd`/../hmi-common
-CFLAGS="$CFLAGS -I $HMI_COMMON_Folder"
-CXXFLAGS="$CXXFLAGS -I $HMI_COMMON_Folder"
-
-dnl enable/disable sanity checks
-AC_ARG_ENABLE(sanity-checks,
- AS_HELP_STRING([--enable-sanity-checks],
- [Enable all sanity checks]),
- [
- if [[ "$enableval" = "yes" ]]; then
- HMI_CTRL_sanity_checks=1
- else
- HMI_CTRL_sanity_checks=0
- fi
- ],
- [HMI_CTRL_sanity_checks=1])
-AC_DEFINE_UNQUOTED(ENABLE_SANITY_CHECKS, $HMI_CTRL_sanity_checks,
- [Enable/Disable sanity checks])
-
dnl check for libhdb-tinyxml
PKG_CHECK_MODULES(HDB_TINYXML, hdb-tinyxml-1.0)
AC_SUBST(HDB_TINYXML_CFLAGS)
@@ -74,10 +17,33 @@
AC_PROG_CXX
AC_GNU_SOURCE
+AC_PROG_LIBTOOL
-AC_CONFIG_HEADERS([hmi-ctrl-config.h])
+AC_CONFIG_HEADERS([asycxx-config.h])
AC_CONFIG_FILES([
Makefile
src/Makefile
+include/Makefile
+asycxx-0.1.pc
])
+AC_CONFIG_LINKS(src/Logger.h:include/asycxx/Logger.h
+ src/Error.h:include/asycxx/Error.h
+ src/Deferred.h:include/asycxx/Deferred.h
+ src/RefCounter.h:include/asycxx/RefCounter.h
+ src/DataBuffer.h:include/asycxx/DataBuffer.h
+ src/Reactor.h:include/asycxx/Reactor.h
+ src/SelectReactor.h:include/asycxx/SelectReactor.h
+ src/Timer.h:include/asycxx/Timer.h
+ src/Transport.h:include/asycxx/Transport.h
+ src/Listener.h:include/asycxx/Listener.h
+ src/TCPTransport.h:include/asycxx/TCPTransport.h
+ src/TCPListener.h:include/asycxx/TCPListener.h
+ src/TCPLLTransport.h:include/asycxx/TCPLLTransport.h
+ src/Protocol.h:include/asycxx/Protocol.h
+ src/Factory.h:include/asycxx/Factory.h
+ src/MsgBus.h:include/asycxx/MsgBus.h
+ src/MsgHandler.h:include/asycxx/MsgHandler.h
+ src/GimpleMsgBus.h:include/asycxx/GimpleMsgBus.h
+ src/XMLParser.h:include/asycxx/XMLParser.h
+ src/asycxx-log.h:include/asycxx/asycxx-log.h)
AC_OUTPUT
Index: trunk/src/Deferred.cxx
===================================================================
--- trunk/src/Deferred.cxx (revision 3)
+++ trunk/src/Deferred.cxx (working copy)
@@ -13,14 +13,14 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <stdlib.h>
#include <errno.h>
#include <string.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Deferred.h"
Index: trunk/src/Timer.cxx
===================================================================
--- trunk/src/Timer.cxx (revision 3)
+++ trunk/src/Timer.cxx (working copy)
@@ -39,12 +39,12 @@
*/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <vector>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Timer.h"
Index: trunk/src/core.cxx
===================================================================
--- trunk/src/core.cxx (revision 3)
+++ trunk/src/core.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <sys/time.h>
@@ -22,7 +22,7 @@
#include <unistd.h>
#include <fcntl.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
h_msecs_t
Index: trunk/src/TCPLLTransport.cxx
===================================================================
--- trunk/src/TCPLLTransport.cxx (revision 3)
+++ trunk/src/TCPLLTransport.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <errno.h>
@@ -23,7 +23,7 @@
#include <netinet/in.h>
#include <netinet/tcp.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Protocol.h"
#include "TCPLLTransport.h"
Index: trunk/src/Transport.cxx
===================================================================
--- trunk/src/Transport.cxx (revision 3)
+++ trunk/src/Transport.cxx (working copy)
@@ -13,12 +13,12 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <unistd.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Transport.h"
#include "Protocol.h"
Index: trunk/src/GimpleMsgBus.cxx
===================================================================
--- trunk/src/GimpleMsgBus.cxx (revision 3)
+++ trunk/src/GimpleMsgBus.cxx (working copy)
@@ -11,13 +11,13 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <string.h>
#include <arpa/inet.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Transport.h"
Index: trunk/src/SelectReactor.cxx
===================================================================
--- trunk/src/SelectReactor.cxx (revision 3)
+++ trunk/src/SelectReactor.cxx (working copy)
@@ -13,14 +13,14 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <sys/select.h>
#include <errno.h>
#include <string.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "SelectReactor.h"
Index: trunk/src/XMLParser.cxx
===================================================================
--- trunk/src/XMLParser.cxx (revision 3)
+++ trunk/src/XMLParser.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <stdio.h>
@@ -21,7 +21,7 @@
#include <errno.h>
#include "XMLParser.h"
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include <hdb-tinyxml/tinyxml.h>
Index: trunk/src/Logger.cxx
===================================================================
--- trunk/src/Logger.cxx (revision 3)
+++ trunk/src/Logger.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <stdio.h>
Index: trunk/src/MsgHandler.cxx
===================================================================
--- trunk/src/MsgHandler.cxx (revision 3)
+++ trunk/src/MsgHandler.cxx (working copy)
@@ -11,10 +11,10 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "MsgHandler.h"
Index: trunk/src/Listener.cxx
===================================================================
--- trunk/src/Listener.cxx (revision 3)
+++ trunk/src/Listener.cxx (working copy)
@@ -13,11 +13,11 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Listener.h"
Index: trunk/src/Error.cxx
===================================================================
--- trunk/src/Error.cxx (revision 3)
+++ trunk/src/Error.cxx (working copy)
@@ -13,14 +13,14 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <execinfo.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
void
Index: trunk/src/TCPListener.cxx
===================================================================
--- trunk/src/TCPListener.cxx (revision 3)
+++ trunk/src/TCPListener.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <sys/types.h>
@@ -26,7 +26,7 @@
#include <errno.h>
#include <unistd.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Factory.h"
#include "Protocol.h"
Index: trunk/src/Reactor.cxx
===================================================================
--- trunk/src/Reactor.cxx (revision 3)
+++ trunk/src/Reactor.cxx (working copy)
@@ -21,13 +21,13 @@
*/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <unistd.h>
#include <exception>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Reactor.h"
#include "Deferred.h"
Index: trunk/src/MsgBus.cxx
===================================================================
--- trunk/src/MsgBus.cxx (revision 3)
+++ trunk/src/MsgBus.cxx (working copy)
@@ -11,10 +11,10 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "MsgBus.h"
#include "MsgHandler.h"
Index: trunk/src/Protocol.cxx
===================================================================
--- trunk/src/Protocol.cxx (revision 3)
+++ trunk/src/Protocol.cxx (working copy)
@@ -13,11 +13,11 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Protocol.h"
Index: trunk/src/DataBuffer.cxx
===================================================================
--- trunk/src/DataBuffer.cxx (revision 3)
+++ trunk/src/DataBuffer.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include "DataBuffer.h"
Index: trunk/src/TCPTransport.cxx
===================================================================
--- trunk/src/TCPTransport.cxx (revision 3)
+++ trunk/src/TCPTransport.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <errno.h>
@@ -24,7 +24,7 @@
#include <sys/socket.h>
#include <errno.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Protocol.h"
#include "TCPTransport.h"
Index: trunk/src/Factory.cxx
===================================================================
--- trunk/src/Factory.cxx (revision 3)
+++ trunk/src/Factory.cxx (working copy)
@@ -13,11 +13,11 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Reactor.h"
#include "Factory.h"
Index: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am (revision 3)
+++ trunk/src/Makefile.am (working copy)
@@ -1,40 +1,28 @@
# -*- mode: makefile; indent-tabs-mode: nil; tab-width: 4; -*-
-AM_LDFLAGS = -lpthread $(HDB_TINYXML_LIBS) -rdynamic
-AM_CXXFLAGS = \
- -DHMI_CTRL_CONFIGDIR=\"$(sysconfdir)/hmi-ctrl/\" \
- -DHMI_CTRL_DATADIR=\"$(pkgdatadir)/data/\" \
- $(HDB_TINYXML_CFLAGS)
+lib_LTLIBRARIES = libasycxx-0.1.la
-
-bin_PROGRAMS = hmi-ctrl hmi-ctrl.debug
-
-hmi_ctrl_SOURCES = \
- Logger.cxx Logger.h \
- Error.cxx Error.h \
- Deferred.cxx Deferred.h \
- RefCounter.cxx RefCounter.h \
- DataBuffer.cxx DataBuffer.h \
- Reactor.cxx Reactor.h \
- SelectReactor.cxx SelectReactor.h \
- Timer.cxx Timer.h \
- Transport.cxx Transport.h \
- Listener.cxx Listener.h \
- TCPTransport.cxx TCPTransport.h \
- TCPListener.cxx TCPListener.h \
- TCPLLTransport.cxx TCPLLTransport.h \
- Protocol.cxx Protocol.h \
- Factory.cxx Factory.h \
- MsgBus.cxx MsgBus.h \
- MsgHandler.cxx MsgHandler.h \
- GimpleMsgBus.cxx GimpleMsgBus.h \
- XMLParser.cxx XMLParser.h \
- Config.cxx Config.h \
- App.cxx App.h \
- hmi-ctrl.cxx hmi-ctrl.h \
+libasycxx_0_1_la_SOURCES = \
+ Logger.cxx \
+ Error.cxx \
+ Deferred.cxx.h \
+ RefCounter.cxx \
+ DataBuffer.cxx \
+ Reactor.cxx \
+ SelectReactor.cxx \
+ Timer.cxx \
+ Transport.cxx \
+ Listener.cxx \
+ TCPTransport.cxx \
+ TCPListener.cxx \
+ TCPLLTransport.cxx \
+ Protocol.cxx \
+ Factory.cxx \
+ MsgBus.cxx \
+ MsgHandler.cxx \
+ GimpleMsgBus.cxx \
+ XMLParser.cxx \
core.cxx
-hmi_ctrl_CXXFLAGS = -O2 $(AM_CXXFLAGS)
-
-hmi_ctrl_debug_SOURCES = $(hmi_ctrl_SOURCES)
-hmi_ctrl_debug_CXXFLAGS = -g $(AM_CXXFLAGS)
+libasycxx_0_1_la_CXXFLAGS = -O2 $(HDB_TINYXML_CFLAGS)
+libasycxx_0_1_la_LDFLAGS = -version-info 0:1:0
Index: trunk/src/RefCounter.cxx
===================================================================
--- trunk/src/RefCounter.cxx (revision 3)
+++ trunk/src/RefCounter.cxx (working copy)
@@ -13,10 +13,10 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "RefCounter.h"
Index: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am (revision 3)
+++ trunk/Makefile.am (working copy)
@@ -1,5 +1,5 @@
# -*- mode: makefile; indent-tabs-mode: nil; tab-width: 4; -*-
-configdir = $(sysconfdir)/hmi-ctrl
-dist_config_DATA = hmi-ctrl-config.xml.sample
+SUBDIRS = src include
-SUBDIRS = src
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = asycxx-0.1.pc
Index: trunk/autogen.sh
===================================================================
--- trunk/autogen.sh (revision 3)
+++ trunk/autogen.sh (working copy)
@@ -2,5 +2,6 @@
echo "Generating build necessaries..."
aclocal
+libtoolize --force
automake --add-missing
autoconf |
|
From: Karthik B. <ka...@hi...> - 2009-02-16 14:29:58
|
Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac (revision 3)
+++ trunk/configure.ac (working copy)
@@ -1,68 +1,11 @@
-AC_INIT([hmi-ctrl], [0.1], jo...@hi...)
+AC_INIT([asycxx], [0.1], jo...@hi...)
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
+AC_PREFIX_DEFAULT(/opt/asycxx)
+
CFLAGS="-Wall -Werror"
CXXFLAGS="-Wall -Werror"
-dnl setup the debug level
-AC_ARG_WITH(verbose-level,
- AS_HELP_STRING([--with-verbose-level],
- [Use the given debug level (0 to 3) 0=disable]),
- [hmi_ctrl_with_verbose_level=$withval],)
-
-if test $hmi_ctrl_with_verbose_level; then
- HMI_CTRL_verbose_level=$hmi_ctrl_with_verbose_level
-else
- HMI_CTRL_verbose_level=2
-fi
-AC_DEFINE_UNQUOTED(HMI_CTRL_VERBOSE_LEVEL, $HMI_CTRL_verbose_level,
- [Controls the amount of logs])
-
-dnl SCM revision tag
-HMI_CTRL_revision=`svn info | grep "^Revision" | cut -d' ' -f 2 -s`
-if [[ "$HMI_CTRL_revision" = "" ]]; then
- HMI_CTRL_revision="unknown"
-fi
-AC_DEFINE_UNQUOTED(HMI_CTRL_REVISION, "$HMI_CTRL_revision",
- [SCM revision number])
-
-dnl setup a release tag
-AC_ARG_WITH(release-tag,
- AS_HELP_STRING([--with-release-tag],
- [Release tag to associate with the build]),
- [HMI_CTRL_release_tag=$withval],)
-
-if test -z $HMI_CTRL_release_tag; then
- HMI_CTRL_release_tag="<DEBUG:Rev=$HMI_CTRL_revision>"
-fi
-AC_DEFINE_UNQUOTED(HMI_CTRL_RELEASE_TAG, "$HMI_CTRL_release_tag",
- [Release tag associated with the build])
-
-
-dnl setup the acw-common
-ACW_COMMON_Folder=`pwd`/../acw-common
-CFLAGS="$CFLAGS -I $ACW_COMMON_Folder"
-CXXFLAGS="$CXXFLAGS -I $ACW_COMMON_Folder"
-dnl setup the hmi-common
-HMI_COMMON_Folder=`pwd`/../hmi-common
-CFLAGS="$CFLAGS -I $HMI_COMMON_Folder"
-CXXFLAGS="$CXXFLAGS -I $HMI_COMMON_Folder"
-
-dnl enable/disable sanity checks
-AC_ARG_ENABLE(sanity-checks,
- AS_HELP_STRING([--enable-sanity-checks],
- [Enable all sanity checks]),
- [
- if [[ "$enableval" = "yes" ]]; then
- HMI_CTRL_sanity_checks=1
- else
- HMI_CTRL_sanity_checks=0
- fi
- ],
- [HMI_CTRL_sanity_checks=1])
-AC_DEFINE_UNQUOTED(ENABLE_SANITY_CHECKS, $HMI_CTRL_sanity_checks,
- [Enable/Disable sanity checks])
-
dnl check for libhdb-tinyxml
PKG_CHECK_MODULES(HDB_TINYXML, hdb-tinyxml-1.0)
AC_SUBST(HDB_TINYXML_CFLAGS)
@@ -74,10 +17,33 @@
AC_PROG_CXX
AC_GNU_SOURCE
+AC_PROG_LIBTOOL
-AC_CONFIG_HEADERS([hmi-ctrl-config.h])
+AC_CONFIG_HEADERS([asycxx-config.h])
AC_CONFIG_FILES([
Makefile
src/Makefile
+include/Makefile
+asycxx-0.1.pc
])
+AC_CONFIG_LINKS(src/Logger.h:include/asycxx/Logger.h
+ src/Error.h:include/asycxx/Error.h
+ src/Deferred.h:include/asycxx/Deferred.h
+ src/RefCounter.h:include/asycxx/RefCounter.h
+ src/DataBuffer.h:include/asycxx/DataBuffer.h
+ src/Reactor.h:include/asycxx/Reactor.h
+ src/SelectReactor.h:include/asycxx/SelectReactor.h
+ src/Timer.h:include/asycxx/Timer.h
+ src/Transport.h:include/asycxx/Transport.h
+ src/Listener.h:include/asycxx/Listener.h
+ src/TCPTransport.h:include/asycxx/TCPTransport.h
+ src/TCPListener.h:include/asycxx/TCPListener.h
+ src/TCPLLTransport.h:include/asycxx/TCPLLTransport.h
+ src/Protocol.h:include/asycxx/Protocol.h
+ src/Factory.h:include/asycxx/Factory.h
+ src/MsgBus.h:include/asycxx/MsgBus.h
+ src/MsgHandler.h:include/asycxx/MsgHandler.h
+ src/GimpleMsgBus.h:include/asycxx/GimpleMsgBus.h
+ src/XMLParser.h:include/asycxx/XMLParser.h
+ src/asycxx-log.h:include/asycxx/asycxx-log.h)
AC_OUTPUT
Index: trunk/src/Deferred.cxx
===================================================================
--- trunk/src/Deferred.cxx (revision 3)
+++ trunk/src/Deferred.cxx (working copy)
@@ -13,14 +13,14 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <stdlib.h>
#include <errno.h>
#include <string.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Deferred.h"
Index: trunk/src/Timer.cxx
===================================================================
--- trunk/src/Timer.cxx (revision 3)
+++ trunk/src/Timer.cxx (working copy)
@@ -39,12 +39,12 @@
*/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <vector>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Timer.h"
Index: trunk/src/core.cxx
===================================================================
--- trunk/src/core.cxx (revision 3)
+++ trunk/src/core.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <sys/time.h>
@@ -22,7 +22,7 @@
#include <unistd.h>
#include <fcntl.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
h_msecs_t
Index: trunk/src/TCPLLTransport.cxx
===================================================================
--- trunk/src/TCPLLTransport.cxx (revision 3)
+++ trunk/src/TCPLLTransport.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <errno.h>
@@ -23,7 +23,7 @@
#include <netinet/in.h>
#include <netinet/tcp.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Protocol.h"
#include "TCPLLTransport.h"
Index: trunk/src/Transport.cxx
===================================================================
--- trunk/src/Transport.cxx (revision 3)
+++ trunk/src/Transport.cxx (working copy)
@@ -13,12 +13,12 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <unistd.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Transport.h"
#include "Protocol.h"
Index: trunk/src/GimpleMsgBus.cxx
===================================================================
--- trunk/src/GimpleMsgBus.cxx (revision 3)
+++ trunk/src/GimpleMsgBus.cxx (working copy)
@@ -11,13 +11,13 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <string.h>
#include <arpa/inet.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Transport.h"
Index: trunk/src/SelectReactor.cxx
===================================================================
--- trunk/src/SelectReactor.cxx (revision 3)
+++ trunk/src/SelectReactor.cxx (working copy)
@@ -13,14 +13,14 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <sys/select.h>
#include <errno.h>
#include <string.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "SelectReactor.h"
Index: trunk/src/XMLParser.cxx
===================================================================
--- trunk/src/XMLParser.cxx (revision 3)
+++ trunk/src/XMLParser.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <stdio.h>
@@ -21,7 +21,7 @@
#include <errno.h>
#include "XMLParser.h"
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include <hdb-tinyxml/tinyxml.h>
Index: trunk/src/Logger.cxx
===================================================================
--- trunk/src/Logger.cxx (revision 3)
+++ trunk/src/Logger.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <stdio.h>
Index: trunk/src/MsgHandler.cxx
===================================================================
--- trunk/src/MsgHandler.cxx (revision 3)
+++ trunk/src/MsgHandler.cxx (working copy)
@@ -11,10 +11,10 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "MsgHandler.h"
Index: trunk/src/Listener.cxx
===================================================================
--- trunk/src/Listener.cxx (revision 3)
+++ trunk/src/Listener.cxx (working copy)
@@ -13,11 +13,11 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Listener.h"
Index: trunk/src/Error.cxx
===================================================================
--- trunk/src/Error.cxx (revision 3)
+++ trunk/src/Error.cxx (working copy)
@@ -13,14 +13,14 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <execinfo.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
void
Index: trunk/src/TCPListener.cxx
===================================================================
--- trunk/src/TCPListener.cxx (revision 3)
+++ trunk/src/TCPListener.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <sys/types.h>
@@ -26,7 +26,7 @@
#include <errno.h>
#include <unistd.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Factory.h"
#include "Protocol.h"
Index: trunk/src/Reactor.cxx
===================================================================
--- trunk/src/Reactor.cxx (revision 3)
+++ trunk/src/Reactor.cxx (working copy)
@@ -21,13 +21,13 @@
*/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <unistd.h>
#include <exception>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Reactor.h"
#include "Deferred.h"
Index: trunk/src/MsgBus.cxx
===================================================================
--- trunk/src/MsgBus.cxx (revision 3)
+++ trunk/src/MsgBus.cxx (working copy)
@@ -11,10 +11,10 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "MsgBus.h"
#include "MsgHandler.h"
Index: trunk/src/Protocol.cxx
===================================================================
--- trunk/src/Protocol.cxx (revision 3)
+++ trunk/src/Protocol.cxx (working copy)
@@ -13,11 +13,11 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Protocol.h"
Index: trunk/src/DataBuffer.cxx
===================================================================
--- trunk/src/DataBuffer.cxx (revision 3)
+++ trunk/src/DataBuffer.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include "DataBuffer.h"
Index: trunk/src/TCPTransport.cxx
===================================================================
--- trunk/src/TCPTransport.cxx (revision 3)
+++ trunk/src/TCPTransport.cxx (working copy)
@@ -13,7 +13,7 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
#include <errno.h>
@@ -24,7 +24,7 @@
#include <sys/socket.h>
#include <errno.h>
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Protocol.h"
#include "TCPTransport.h"
Index: trunk/src/Factory.cxx
===================================================================
--- trunk/src/Factory.cxx (revision 3)
+++ trunk/src/Factory.cxx (working copy)
@@ -13,11 +13,11 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "Reactor.h"
#include "Factory.h"
Index: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am (revision 3)
+++ trunk/src/Makefile.am (working copy)
@@ -1,40 +1,28 @@
# -*- mode: makefile; indent-tabs-mode: nil; tab-width: 4; -*-
-AM_LDFLAGS = -lpthread $(HDB_TINYXML_LIBS) -rdynamic
-AM_CXXFLAGS = \
- -DHMI_CTRL_CONFIGDIR=\"$(sysconfdir)/hmi-ctrl/\" \
- -DHMI_CTRL_DATADIR=\"$(pkgdatadir)/data/\" \
- $(HDB_TINYXML_CFLAGS)
+lib_LTLIBRARIES = libasycxx-0.1.la
-
-bin_PROGRAMS = hmi-ctrl hmi-ctrl.debug
-
-hmi_ctrl_SOURCES = \
- Logger.cxx Logger.h \
- Error.cxx Error.h \
- Deferred.cxx Deferred.h \
- RefCounter.cxx RefCounter.h \
- DataBuffer.cxx DataBuffer.h \
- Reactor.cxx Reactor.h \
- SelectReactor.cxx SelectReactor.h \
- Timer.cxx Timer.h \
- Transport.cxx Transport.h \
- Listener.cxx Listener.h \
- TCPTransport.cxx TCPTransport.h \
- TCPListener.cxx TCPListener.h \
- TCPLLTransport.cxx TCPLLTransport.h \
- Protocol.cxx Protocol.h \
- Factory.cxx Factory.h \
- MsgBus.cxx MsgBus.h \
- MsgHandler.cxx MsgHandler.h \
- GimpleMsgBus.cxx GimpleMsgBus.h \
- XMLParser.cxx XMLParser.h \
- Config.cxx Config.h \
- App.cxx App.h \
- hmi-ctrl.cxx hmi-ctrl.h \
+libasycxx_0_1_la_SOURCES = \
+ Logger.cxx \
+ Error.cxx \
+ Deferred.cxx.h \
+ RefCounter.cxx \
+ DataBuffer.cxx \
+ Reactor.cxx \
+ SelectReactor.cxx \
+ Timer.cxx \
+ Transport.cxx \
+ Listener.cxx \
+ TCPTransport.cxx \
+ TCPListener.cxx \
+ TCPLLTransport.cxx \
+ Protocol.cxx \
+ Factory.cxx \
+ MsgBus.cxx \
+ MsgHandler.cxx \
+ GimpleMsgBus.cxx \
+ XMLParser.cxx \
core.cxx
-hmi_ctrl_CXXFLAGS = -O2 $(AM_CXXFLAGS)
-
-hmi_ctrl_debug_SOURCES = $(hmi_ctrl_SOURCES)
-hmi_ctrl_debug_CXXFLAGS = -g $(AM_CXXFLAGS)
+libasycxx_0_1_la_CXXFLAGS = -O2 $(HDB_TINYXML_CFLAGS)
+libasycxx_0_1_la_LDFLAGS = -version-info 0:1:0
Index: trunk/src/RefCounter.cxx
===================================================================
--- trunk/src/RefCounter.cxx (revision 3)
+++ trunk/src/RefCounter.cxx (working copy)
@@ -13,10 +13,10 @@
*******************************************************************/
#ifdef HAVE_CONFIG_H
-#include <hmi-ctrl-config.h>
+#include <asycxx-config.h>
#endif
-#include "hmi-ctrl.h"
+#include "asycxx-log.h"
#include "Error.h"
#include "RefCounter.h"
Index: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am (revision 3)
+++ trunk/Makefile.am (working copy)
@@ -1,5 +1,5 @@
# -*- mode: makefile; indent-tabs-mode: nil; tab-width: 4; -*-
-configdir = $(sysconfdir)/hmi-ctrl
-dist_config_DATA = hmi-ctrl-config.xml.sample
+SUBDIRS = src include
-SUBDIRS = src
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = asycxx-0.1.pc
Index: trunk/autogen.sh
===================================================================
--- trunk/autogen.sh (revision 3)
+++ trunk/autogen.sh (working copy)
@@ -2,5 +2,6 @@
echo "Generating build necessaries..."
aclocal
+libtoolize --force
automake --add-missing
autoconf |
|
From: Joe S. <js...@hi...> - 2009-02-16 14:22:18
|
Karthik Balakrishnan wrote: > 1. asycxx is a library with header files available for further code > development Correct. > 2. asycxx is standalone library and all VeeJay related files and > references are to be removed Correct. > Assuming this is how asycxx is supposed to be I've done quite numerous > changes in the directory structuring, Makefile.am, configure.ac > <http://configure.ac> and others. Post a patch. Lets have a look at what you have changed. > Secondly, I have manually altered the .cxx and .h files to include > asycxx-config.h instead of hmi-ctrl-config.h which I doubt is the right way. Please > confirm. That is the right way. I just slurped and plonked the code. :D Was too lazy (or lack of time) to fix it before pushing it in. > The asycxx-config.h was autogenerated using autoheader after altering > configure.ac <http://configure.ac and Makefile.am files. I've also created one .pc file for asycxx using > the template given in pkg-config man page. Cool. When installing asycxx, we'll have to install both the 'dev files' and the run-time library. > One header file hmi-ctrl.h has no reference to VeeJay project but has > many macros defined which I have retained and renamed to asycxx.h. Good :) > The directories are now re-structured and the .h files are moved under a > separate include directory and .cxx under src directory. (similar to hdb-tinyxml) Good :) > Compilation of the code and installation works just fine and considering > the changes that were done I'd recommend that I tar ball the source instead of > sending across the patch file, which after your review can be marked as base in source > control. No no. post patch. A patch should be much smaller than a tar-ball of the whole thing. I can see the changes easier with a patch. In the working copy, just do a 'svn diff' and redirect the output to a file. Attach that file and post it. -- Joe Steeve HiPro IT Solutions Pvt. Ltd. http://hipro.co.in/ |
|
From: Karthik B. <ka...@hi...> - 2009-02-16 04:29:32
|
Joe,
Please confirm the following requirement on asycxx
1. asycxx is a library with header files available for further code
development
2. asycxx is standalone library and all VeeJay related files and references
are
to be removed
Assuming this is how asycxx is supposed to be I've done quite numerous
changes in the directory structuring, Makefile.am, configure.ac and others.
Secondly, I have manually altered the .cxx and .h files to include
asycxx-config.h
instead of hmi-ctrl-config.h which I doubt is the right way. Please confirm.
The asycxx-config.h was autogenerated using autoheader after altering
configure.ac
and Makefile.am files. I've also created one .pc file for asycxx using the
template given
in pkg-config man page.
One header file hmi-ctrl.h has no reference to VeeJay project but has many
macros
defined which I have retained and renamed to asycxx.h.
The directories are now re-structured and the .h files are moved under a
separate
include directory and .cxx under src directory. (similar to hdb-tinyxml)
Compilation of the code and installation works just fine and considering the
changes
that were done I'd recommend that I tar ball the source instead of sending
across
the patch file, which after your review can be marked as base in source
control.
If there is anything you wish to add or update me on i'm glad to get it
done.
--
Karthik
HiPro IT Solutions Pvt. Ltd.
http://hipro.co.in/
|
|
From: Joe S. <js...@hi...> - 2009-02-07 10:17:39
|
Karthik Balakrishnan wrote: > 2. during ./configure of asycxx trunk folder i got the error: > " > checking for HDB_TINYXML... configure: error: Package requirements > (hdb-tinyxml-1.0) were not met: > > No package 'hdb-tinyxml-1.0' found > > Consider adjusting the PKG_CONFIG_PATH environment variable if you > installed software in a non-standard prefix. > " > > and when I checked, the PKG_CONFIG_PATH env variable was not set. I > am not sure how this happened. Anyway, I manually set the path to: > "/opt/hdb/lib/pkgconfig" and now ./configure went through fine. I usually configure with the following line; ./autogen.sh ; PKG_CONFIG_PATH=/opt/hdb/lib/pkgconfig/ ./configure --prefix=`pwd`/test --with-debug-level=3 > 3. During make got the following error: > " > App.cxx:25:28: error: SpindleManager.h: No such file or directory > cc1plus: warnings being treated as errors > " > This header file is missing and i am not sure if it is required and is > part of the asycxx. If this file is required do add to the sourcecontrol area. Those are not part of asycxx. Even App.cxx is not part of asycxx. asycxx should be built as a library and the target application should link to it. We'll have to have a test folder where we have test applications to test asycxx. -- Joe Steeve HiPro IT Solutions Pvt. Ltd. http://hipro.co.in/ |
|
From: Karthik B. <ka...@hi...> - 2009-02-06 20:49:54
|
Joe,
Here are the details during compilation:
1. the hdb-tinyxml-1.0 got compiled and was installed successfully
in /opt/hdb/ folder.
a) the pkgconfig folder got created under the lib directory with
the .pc file
2. during ./configure of asycxx trunk folder i got the error:
"
checking for HDB_TINYXML... configure: error: Package requirements
(hdb-tinyxml-1.0) were not met:
No package 'hdb-tinyxml-1.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
"
and when I checked, the PKG_CONFIG_PATH env variable was not set. I
am not sure how this happened. Anyway, I manually set the path to:
"/opt/hdb/lib/pkgconfig" and now ./configure went through fine.
3. During make got the following error:
"
App.cxx:25:28: error: SpindleManager.h: No such file or directory
cc1plus: warnings being treated as errors
"
This header file is missing and i am not sure if it is required and is part
of the asycxx. If this file is required do add to the sourcecontrol area.
--
Karthik
HiPro IT Solutions Pvt. Ltd.
http://hipro.co.in/
P.S: I haven't read through the code yet as I was only trying to get the
library built.
|