SampleAgent.h

Go to the documentation of this file.
00001 /*
00002  * examples/modules/SampleAgent.h
00003  *
00004  * Copyright (C) 2008 by Singularity Institute for Artificial Intelligence
00005  * All Rights Reserved
00006  *
00007  * Written by Gustavo Gama <gama@vettalabs.com>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU Affero General Public License v3 as
00011  * published by the Free Software Foundation and including the exceptions
00012  * at http://opencog.org/wiki/Licenses
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Affero General Public License
00020  * along with this program; if not, write to:
00021  * Free Software Foundation, Inc.,
00022  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00023  */
00024 
00025 #ifndef _OPENCOG_SAMPLE_AGENT_H
00026 #define _OPENCOG_SAMPLE_AGENT_H
00027 
00028 #include <string>
00029 
00030 #include <opencog/server/Agent.h>
00031 #include <opencog/server/Factory.h>
00032 #include <opencog/server/Module.h>
00033 
00034 namespace opencog
00035 {
00036 
00037 class CogServer;
00038 
00039 class SampleAgent : public Agent
00040 {
00041 public:
00042 
00043     virtual const ClassInfo& classinfo() const { return info(); }
00044     static const ClassInfo& info() {
00045         static const ClassInfo _ci("opencog::SampleAgent");
00046         return _ci;
00047     }
00048 
00049     SampleAgent();
00050     ~SampleAgent();
00051     void run(CogServer*);
00052 
00053 }; // class
00054 
00055 class SampleModule : public Module
00056 {
00057 private:
00058 
00059     Factory<SampleAgent, Agent> factory;
00060 
00061 public:
00062 
00063     static const ClassInfo& info() {
00064         static const ClassInfo _ci("opencog::SampleModule");
00065         return _ci;
00066     }
00067 
00068     SampleModule();
00069     ~SampleModule();
00070     void init();
00071 };
00072 
00073 } // namespace opencog
00074 
00075 #endif // _OPENCOG_SAMPLE_AGENT_H

Generated on Fri Dec 4 23:23:25 2009 for OpenCog Framework by  doxygen 1.5.6