From 735cd1ff00013afdc57907ea902f4616b340c99c Mon Sep 17 00:00:00 2001 From: Ethereal Date: Sat, 19 Feb 2011 17:10:57 -0700 Subject: [PATCH] Revert "Started experimenting with perl/python scripts to auto rename incl guards etc." This reverts commit a4e45c06fb61a51a363e5bc0e5dcb2c0764f8fc9. --- .../Interface.h => common/MarshallerInterface.h} | 4 +-- include/{ => common}/ModuleID.h | 6 ++-- include/{vcomm => common}/NetworkPacket.h | 10 +++--- .../NetworkPacket.h => common/Preprocessor.h} | 18 +++++------ include/{shm => common}/SHMPacket.h | 6 ++-- include/{shm => common}/SharedMemoryHeader.h | 6 ++-- include/{vcomm => common}/VPacket.h | 10 +++--- include/{shm => common}/ZoneHeader.h | 6 ++-- include/monitor/module/Module.h | 2 +- include/shm/SharedMemory.h | 12 ++++--- include/shm/ZoneReader.h | 12 ++++--- include/vcomm/DataSink.h | 12 ++++--- include/vcomm/GeneralSink.h | 12 ++++--- include/vcomm/LogSink.h | 12 ++++--- include/vcomm/NetworkSink.h | 12 ++++--- newsource.py | 5 ++- pl.pl | 37 ---------------------- 17 files changed, 77 insertions(+), 105 deletions(-) rename include/{marshaller/Interface.h => common/MarshallerInterface.h} (90%) rename include/{ => common}/ModuleID.h (76%) copy include/{vcomm => common}/NetworkPacket.h (69%) rename include/{vcomm/NetworkPacket.h => common/Preprocessor.h} (52%) rename include/{shm => common}/SHMPacket.h (83%) rename include/{shm => common}/SharedMemoryHeader.h (91%) rename include/{vcomm => common}/VPacket.h (87%) rename include/{shm => common}/ZoneHeader.h (93%) delete mode 100755 pl.pl diff --git a/include/marshaller/Interface.h b/include/common/MarshallerInterface.h similarity index 90% rename from include/marshaller/Interface.h rename to include/common/MarshallerInterface.h index c46b4ce..bd96157 100644 --- a/include/marshaller/Interface.h +++ b/include/common/MarshallerInterface.h @@ -5,14 +5,14 @@ Aesalon is distributed under the terms of the GNU GPLv3. For more licensing information, see the file LICENSE included with the distribution. - @file include/marshaller/Interface.h + @file include/common/MarshallerInterface.h */ #ifndef AesalonCommon_MarshallerInterface_H #define AesalonCommon_MarshallerInterface_H -#include "vcomm/VPacket.h" +#include "VPacket.h" #include "vcommunication/DataSink.h" namespace Common { diff --git a/include/ModuleID.h b/include/common/ModuleID.h similarity index 76% rename from include/ModuleID.h rename to include/common/ModuleID.h index 9ac2625..0f6e4a4 100644 --- a/include/ModuleID.h +++ b/include/common/ModuleID.h @@ -5,12 +5,12 @@ Aesalon is distributed under the terms of the GNU GPLv3. For more licensing information, see the file LICENSE included with the distribution. - @file include/ModuleID.h + @file include/common/ModuleID.h */ -#ifndef Aesalon_ModuleID_H -#define Aesalon_ModuleID_H +#ifndef AesalonCommon_ModuleID_H +#define AesalonCommon_ModuleID_H #include diff --git a/include/vcomm/NetworkPacket.h b/include/common/NetworkPacket.h similarity index 69% copy from include/vcomm/NetworkPacket.h copy to include/common/NetworkPacket.h index 4c3a02f..63eda6e 100644 --- a/include/vcomm/NetworkPacket.h +++ b/include/common/NetworkPacket.h @@ -5,14 +5,14 @@ Aesalon is distributed under the terms of the GNU GPLv3. For more licensing information, see the file LICENSE included with the distribution. - @file include/vcomm/NetworkPacket.h + @file include/common/NetworkPacket.h */ -#ifndef AesalonVComm_NetworkPacket_H -#define AesalonVComm_NetworkPacket_H +#ifndef AesalonCommon_NetworkPacket_H +#define AesalonCommon_NetworkPacket_H -namespace VComm { +namespace Common { class NetworkPacket { public: @@ -20,6 +20,6 @@ public: ~NetworkPacket(); }; -} // namespace VComm +} // namespace Common #endif diff --git a/include/vcomm/NetworkPacket.h b/include/common/Preprocessor.h similarity index 52% rename from include/vcomm/NetworkPacket.h rename to include/common/Preprocessor.h index 4c3a02f..91644c1 100644 --- a/include/vcomm/NetworkPacket.h +++ b/include/common/Preprocessor.h @@ -5,21 +5,19 @@ Aesalon is distributed under the terms of the GNU GPLv3. For more licensing information, see the file LICENSE included with the distribution. - @file include/vcomm/NetworkPacket.h + @file include/common/Preprocessor.h */ -#ifndef AesalonVComm_NetworkPacket_H -#define AesalonVComm_NetworkPacket_H +#ifndef AesalonCommon_Preprocessor_H +#define AesalonCommon_Preprocessor_H -namespace VComm { +#include "monitor/config/Vault.h" -class NetworkPacket { -public: - NetworkPacket(); - ~NetworkPacket(); -}; +namespace Common { -} // namespace VComm +typedef void (*Preprocessor)(Monitor::Config::Vault *vault); + +} // namespace Common #endif diff --git a/include/shm/SHMPacket.h b/include/common/SHMPacket.h similarity index 83% rename from include/shm/SHMPacket.h rename to include/common/SHMPacket.h index a6704e0..ad2738a 100644 --- a/include/shm/SHMPacket.h +++ b/include/common/SHMPacket.h @@ -5,12 +5,12 @@ Aesalon is distributed under the terms of the GNU GPLv3. For more licensing information, see the file LICENSE included with the distribution. - @file include/shm/SHMPacket.h + @file include/common/SHMPacket.h */ -#ifndef AesalonSHM_SHMPacket_H -#define AesalonSHM_SHMPacket_H +#ifndef AesalonCommon_SHMPacket_H +#define AesalonCommon_SHMPacket_H #include "ModuleID.h" diff --git a/include/shm/SharedMemoryHeader.h b/include/common/SharedMemoryHeader.h similarity index 91% rename from include/shm/SharedMemoryHeader.h rename to include/common/SharedMemoryHeader.h index b1782b5..4a2055a 100644 --- a/include/shm/SharedMemoryHeader.h +++ b/include/common/SharedMemoryHeader.h @@ -5,12 +5,12 @@ Aesalon is distributed under the terms of the GNU GPLv3. For more licensing information, see the file LICENSE included with the distribution. - @file include/shm/SharedMemoryHeader.h + @file include/common/SharedMemoryHeader.h */ -#ifndef AesalonSHM_SharedMemoryHeader_H -#define AesalonSHM_SharedMemoryHeader_H +#ifndef AesalonCommon_SharedMemoryHeader_H +#define AesalonCommon_SharedMemoryHeader_H #include #include diff --git a/include/vcomm/VPacket.h b/include/common/VPacket.h similarity index 87% rename from include/vcomm/VPacket.h rename to include/common/VPacket.h index ed560c2..711b908 100644 --- a/include/vcomm/VPacket.h +++ b/include/common/VPacket.h @@ -5,18 +5,18 @@ Aesalon is distributed under the terms of the GNU GPLv3. For more licensing information, see the file LICENSE included with the distribution. - @file include/vcomm/VPacket.h + @file include/common/VPacket.h */ -#ifndef AesalonVComm_VPacket_H -#define AesalonVComm_VPacket_H +#ifndef AesalonCommon_VPacket_H +#define AesalonCommon_VPacket_H #include #include "ModuleID.h" -namespace VComm { +namespace Common { class VPacket { private: @@ -38,6 +38,6 @@ public: uint32_t dataSize() const { return m_dataSize; } }; -} // namespace VComm +} // namespace Common #endif diff --git a/include/shm/ZoneHeader.h b/include/common/ZoneHeader.h similarity index 93% rename from include/shm/ZoneHeader.h rename to include/common/ZoneHeader.h index 0f572c0..a4f277a 100644 --- a/include/shm/ZoneHeader.h +++ b/include/common/ZoneHeader.h @@ -5,12 +5,12 @@ Aesalon is distributed under the terms of the GNU GPLv3. For more licensing information, see the file LICENSE included with the distribution. - @file include/shm/ZoneHeader.h + @file include/common/ZoneHeader.h */ -#ifndef AesalonSHM_ZoneHeader_H -#define AesalonSHM_ZoneHeader_H +#ifndef AesalonCommon_ZoneHeader_H +#define AesalonCommon_ZoneHeader_H #include #include diff --git a/include/monitor/module/Module.h b/include/monitor/module/Module.h index 58bd17f..78dfc6f 100644 --- a/include/monitor/module/Module.h +++ b/include/monitor/module/Module.h @@ -15,7 +15,7 @@ #include #include "config/Vault.h" -#include "marshaller/Interface.h" +#include "common/MarshallerInterface.h" namespace Monitor { namespace Module { diff --git a/include/shm/SharedMemory.h b/include/shm/SharedMemory.h index 22ad676..91ce1e5 100644 --- a/include/shm/SharedMemory.h +++ b/include/shm/SharedMemory.h @@ -5,12 +5,12 @@ Aesalon is distributed under the terms of the GNU GPLv3. For more licensing information, see the file LICENSE included with the distribution. - @file include/shm/SharedMemory.h + @file include/monitor/program/SharedMemory.h */ -#ifndef AesalonSHM_SharedMemory_H -#define AesalonSHM_SharedMemory_H +#ifndef AesalonMonitor_Program_SharedMemory_H +#define AesalonMonitor_Program_SharedMemory_H #include #include @@ -18,7 +18,8 @@ #include "common/SharedMemoryHeader.h" #include "common/ZoneHeader.h" -namespace SHM { +namespace Monitor { +namespace Program { class SharedMemory { private: @@ -46,6 +47,7 @@ private: void setupZones(); }; -} // namespace SHM +} // namespace Program +} // namespace Monitor #endif diff --git a/include/shm/ZoneReader.h b/include/shm/ZoneReader.h index 1d57a0b..8518494 100644 --- a/include/shm/ZoneReader.h +++ b/include/shm/ZoneReader.h @@ -5,12 +5,12 @@ Aesalon is distributed under the terms of the GNU GPLv3. For more licensing information, see the file LICENSE included with the distribution. - @file include/shm/ZoneReader.h + @file include/monitor/program/ZoneReader.h */ -#ifndef AesalonSHM_ZoneReader_H -#define AesalonSHM_ZoneReader_H +#ifndef AesalonMonitor_Program_ZoneReader_H +#define AesalonMonitor_Program_ZoneReader_H #include @@ -18,7 +18,8 @@ #include "SharedMemory.h" #include "vcommunication/DataSink.h" -namespace SHM { +namespace Monitor { +namespace Program { class ZoneReader { private: @@ -38,6 +39,7 @@ private: static void *run(void *voidInstance); }; -} // namespace SHM +} // namespace Program +} // namespace Monitor #endif diff --git a/include/vcomm/DataSink.h b/include/vcomm/DataSink.h index 7d3fb91..7445b05 100644 --- a/include/vcomm/DataSink.h +++ b/include/vcomm/DataSink.h @@ -5,16 +5,17 @@ Aesalon is distributed under the terms of the GNU GPLv3. For more licensing information, see the file LICENSE included with the distribution. - @file include/vcomm/DataSink.h + @file include/monitor/vcommunication/DataSink.h */ -#ifndef AesalonVComm_DataSink_H -#define AesalonVComm_DataSink_H +#ifndef AesalonMonitor_VCommunication_DataSink_H +#define AesalonMonitor_VCommunication_DataSink_H #include "common/VPacket.h" -namespace VComm { +namespace Monitor { +namespace VCommunication { class DataSink { public: @@ -24,6 +25,7 @@ public: virtual void sinkPacket(Common::VPacket *packet) = 0; }; -} // namespace VComm +} // namespace VCommunication +} // namespace Monitor #endif diff --git a/include/vcomm/GeneralSink.h b/include/vcomm/GeneralSink.h index c5613eb..950c707 100644 --- a/include/vcomm/GeneralSink.h +++ b/include/vcomm/GeneralSink.h @@ -5,18 +5,19 @@ Aesalon is distributed under the terms of the GNU GPLv3. For more licensing information, see the file LICENSE included with the distribution. - @file include/vcomm/GeneralSink.h + @file include/monitor/vcommunication/GeneralSink.h */ -#ifndef AesalonVComm_GeneralSink_H -#define AesalonVComm_GeneralSink_H +#ifndef AesalonMonitor_VCommunication_GeneralSink_H +#define AesalonMonitor_VCommunication_GeneralSink_H #include #include "DataSink.h" -namespace VComm { +namespace Monitor { +namespace VCommunication { class GeneralSink : public DataSink { private: @@ -31,6 +32,7 @@ public: virtual void sinkPacket(Common::VPacket *packet); }; -} // namespace VComm +} // namespace VCommunication +} // namespace Monitor #endif diff --git a/include/vcomm/LogSink.h b/include/vcomm/LogSink.h index d479a18..be2f763 100644 --- a/include/vcomm/LogSink.h +++ b/include/vcomm/LogSink.h @@ -5,18 +5,19 @@ Aesalon is distributed under the terms of the GNU GPLv3. For more licensing information, see the file LICENSE included with the distribution. - @file include/vcomm/LogSink.h + @file include/monitor/vcommunication/LogSink.h */ -#ifndef AesalonVComm_LogSink_H -#define AesalonVComm_LogSink_H +#ifndef AesalonMonitor_VCommunication_LogSink_H +#define AesalonMonitor_VCommunication_LogSink_H #include #include "DataSink.h" -namespace VComm { +namespace Monitor { +namespace VCommunication { class LogSink : public DataSink { private: @@ -31,6 +32,7 @@ public: virtual void sinkPacket(Common::VPacket *packet); }; -} // namespace VComm +} // namespace VCommunication +} // namespace Monitor #endif diff --git a/include/vcomm/NetworkSink.h b/include/vcomm/NetworkSink.h index 8a23869..17e5ec7 100644 --- a/include/vcomm/NetworkSink.h +++ b/include/vcomm/NetworkSink.h @@ -5,12 +5,12 @@ Aesalon is distributed under the terms of the GNU GPLv3. For more licensing information, see the file LICENSE included with the distribution. - @file include/vcomm/NetworkSink.h + @file include/monitor/vcommunication/NetworkSink.h */ -#ifndef AesalonVComm_NetworkSink_H -#define AesalonVComm_NetworkSink_H +#ifndef AesalonMonitor_VCommunication_NetworkSink_H +#define AesalonMonitor_VCommunication_NetworkSink_H #include @@ -18,7 +18,8 @@ #include "DataSink.h" -namespace VComm { +namespace Monitor { +namespace VCommunication { class NetworkSink : public DataSink { private: @@ -43,6 +44,7 @@ private: void sendPacket(Common::VPacket *packet, int fd); }; -} // namespace VComm +} // namespace VCommunication +} // namespace Monitor #endif diff --git a/newsource.py b/newsource.py index a658a65..0db3a1d 100755 --- a/newsource.py +++ b/newsource.py @@ -162,8 +162,7 @@ class CppHeader(Generator): path += ".h" filepath = os.path.join(config["incBase"], path) - #fp = file(filepath, "w") - fp = sys.stdout + fp = file(filepath, "w") includeGuard = config["guardBase"] + " " + name.replace("/", "_") includeGuard = includeGuard.replace("::", "_") @@ -199,7 +198,7 @@ class CppHeader(Generator): fp.write(config["cppHeaderEnd"] % fileConfig) - #fp.close() + fp.close() return path diff --git a/pl.pl b/pl.pl deleted file mode 100755 index 04cedf6..0000000 --- a/pl.pl +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/perl - -my $file = $ARGV[0]; - -my $class = $file; -$class =~ s/\.h//; -$class =~ s|/|::|; -$class =~ s|::(.)|'::'.uc($1)|e; -$class =~ s|[Vv]comm|VComm|; -$class =~ s|shm|SHM|i; - -#print "$class\n"; - -open(FILE, "<$file") or die; - -while() { - if(/\@file/) { - print `/tmp/newsource.py cppheader $class | grep '\@file'`; - } - elsif(/^#define Aesalon/) { - print `/tmp/newsource.py cppheader $class | grep define`; - } - elsif(/^#ifndef Aesalon/) { - print `/tmp/newsource.py cppheader $class | grep ifndef`; - } - elsif(/^namespace /) { - print `/tmp/newsource.py cppheader $class | grep ^namespace` if !$ns; - $ns = 1; - } - elsif(m|^} //|) { - print `/tmp/newsource.py cppheader $class | grep '^} //'` if !$close; - $close = 1; - } - else { - print; - } -} -- 2.11.4.GIT