1. 1 The Gospel According to C++ (Lite version)
2 by Patrick Connor
3
4 // *******************************************************************
5 //
6 // Class representing God (a singleton)
7 //
8 // *******************************************************************
9 public class God {
10
11 // no constructors or destructors
12
13 private:
14
15 // creation of the world and humanity
16 void initUniverseAndHumanity();
17
18 // God is at work daily in the lives of everyday people
19 void workInTheWorld();
20
21 // Knowing our problem with Sin accumulation, God becomes
22 // a man (Jesus) and, loving us dearly, provides a way to clear sins.
23 void transformIntoMan3D();
24
25 // at the end of time on earth, God will judge humanity
26 void judgeTheWorld()
27 {
28 for (unsigned i = 0; i < ::getNumHumans(); i++)
29 testPerson(::getHumanSoul(i));
30 }
31
32 // judges a human based on number of sins
33 void testPerson(Soul &person)
34 {
35 if (person.getSinRecords().size() == 0)
36 ::getHeaven().admitOne(person);
37 else
38 ::getHell().admitOne(person);
39 }
40 }
41
42 // *******************************************************************
43 //
44 // Class representing the Soul
45 //
46 // *******************************************************************
47 public class Soul
48 {
49
50 public:
51 // default constructor
52 Soul(void);
53
54 // no destructor;
55
56 // accessor methods
57 std::vector<std::auto_ptr<SinRecord> >& getSins();
58
59 private:
2. 60 // private members
61 // array containing a list of sins committed by human
62 std::vector<std::auto_ptr<SinRecord> > listOfSins;
63
64 // array of good deeds done
65 std::vector<std::auto_ptr<GoodDeed> > listOfGoodDeeds;
66
67 }
68
69 // *******************************************************************
70 //
71 // Class representing people
72 //
73 // *******************************************************************
74 public class Human
75 {
76
77 // constructors, destructors
78 Human(bool bGenderMF, Soul person);
79 ~Human();
80
81 // public methods
82 void live(int numDays);
83
84 private:
85 // private methods
86
87 // called when human trusts in Jesus' sacrifice to clear sins
88 void trustsInJesusSacrifice(void)
89 {
90 std::vector<std::auto_ptr<SinRecord> > listOfSins
91 = this->m_mySoul.getSins();
92 for (size_t i = 0; i < listOfSins.size(); i++)
93 ::getJesusList().push_back(listOfSins[i]);
94 listOfSins.pop_back();
95 }
96
97 // during daily activities humans do:
98 void doGoodDeed(GoodDeed &deed);
99 void doSin(SinRecord &sin);
100
101 // private methdods
102 Soul m_mySoul;
103
104 bool m_maleFemale;
105
106 }
107