00001 /* 00002 * Copyright 2007 Baylor University 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #ifndef _PROPHET_ORACLE_H_ 00018 #define _PROPHET_ORACLE_H_ 00019 00020 #include "Params.h" 00021 #include "Stats.h" 00022 #include "Table.h" 00023 #include "Repository.h" 00024 #include "AckList.h" 00025 #include "BundleCore.h" 00026 00027 namespace prophet 00028 { 00029 00035 class Oracle 00036 { 00037 public: 00038 virtual ~Oracle() {} 00039 // params are read-only for Encounter 00040 virtual const ProphetParams* params() const = 0; 00041 virtual Stats* stats() = 0; 00042 virtual Table* nodes() = 0; 00043 virtual AckList* acks() = 0; 00044 virtual BundleCore* core() = 0; 00045 virtual void ack(const prophet::Bundle* b) 00046 { 00047 if (b == NULL) return; 00048 acks()->insert(b,core()); 00049 stats()->drop_bundle(b); 00050 core()->drop_bundle(b); 00051 } 00052 }; // class Oracle 00053 00054 }; // namespace prophet 00055 00056 #endif // _PROPHET_ORACLE_H_