Move generated code to implementation file.

Change-Id: I5c1e250a0cfd3aecf84709b90bc01a97e5673eaf
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/Makefile.am b/Makefile.am
index 3915eab..0c1a9f7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,6 +3,7 @@
 phosphor_inventory_SOURCES = \
 	app.cpp \
 	xyz.openbmc_project.Inventory.Manager.cpp \
+	generated.cpp \
 	manager.cpp
 phosphor_inventory_LDFLAGS = $(SYSTEMD_LIBS)
 phosphor_inventory_CFLAGS = $(SYSTEMD_CFLAGS)
diff --git a/manager.cpp b/manager.cpp
index d77f128..a846a0b 100644
--- a/manager.cpp
+++ b/manager.cpp
@@ -166,8 +166,6 @@
     _refs.erase(_root + p);
 }
 
-#include "generated.hpp"
-
 } // namespace manager
 } // namespace inventory
 } // namespace phosphor
diff --git a/pimgen.py b/pimgen.py
index 301e7d9..c21c418 100755
--- a/pimgen.py
+++ b/pimgen.py
@@ -146,7 +146,7 @@
         'scanner and code generator.')
     parser.add_argument(
         '-o', '--output', dest='output',
-        default='generated.hpp', help='Output file name.')
+        default='generated.cpp', help='Output file name.')
     parser.add_argument(
         '-d', '--dir', dest='inputdir',
         default=os.path.join('example', 'events'),
@@ -164,12 +164,23 @@
 
     head = """// This file was auto generated.  Do not edit.
 
-#pragma once
+#include "manager.hpp"
+
+namespace phosphor
+{
+namespace inventory
+{
+namespace manager
+{
 
 const Manager::Events Manager::_events{
 """
 
     tail = """};
+
+} // namespace manager
+} // namespace inventory
+} // namespace phosphor
 """
 
     r = ParseList([get_parsers(x) for x in yaml_files])()
diff --git a/test/Makefile.am b/test/Makefile.am
index 48d2bb5..94baa9a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -6,4 +6,5 @@
 phosphor_inventory_test_CFLAGS = $(SYSTEMD_CFLAGS)
 phosphor_inventory_test_LDADD = ${top_builddir}/manager.o \
 				${top_builddir}/filters.o \
+				${top_builddir}/generated.o \
 				${top_builddir}/xyz.openbmc_project.Inventory.Manager.o