RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
core/banker/null_banker.cc
00001 /* null_banker.cc
00002    Jeremy Barnes, 11 October 2012
00003    Copyright (c) 2012 Datacratic Inc.  All rights reserved.
00004 
00005    Null banker implementation.
00006 */
00007 
00008 #include "null_banker.h"
00009 
00010 using namespace std;
00011 using namespace ML;
00012 
00013 namespace RTBKIT {
00014 
00015 
00016 /*****************************************************************************/
00017 /* NULL BANKER                                                               */
00018 /*****************************************************************************/
00019 
00020 void
00021 NullBudgetController::
00022 addAccountSync(const AccountKey & account)
00023 {
00024     cerr << "added account " << account << endl;
00025 }
00026 
00027 void
00028 NullBudgetController::
00029 topupTransferSync(const AccountKey & account,
00030                   CurrencyPool amount)
00031 {
00032     cerr << "transferring " << amount << " to " << account << endl;
00033 }
00034 
00035 void
00036 NullBudgetController::
00037 setBudgetSync(const std::string & topLevelCampaign,
00038               CurrencyPool amount)
00039 {
00040     cerr << "setting budget for " << topLevelCampaign
00041          << " to " << amount << endl;
00042 }
00043 
00044 void
00045 NullBudgetController::
00046 addBudgetSync(const std::string & topLevelCampaign,
00047               CurrencyPool amount)
00048 {
00049     cerr << "adding budget for " << topLevelCampaign
00050          << " to " << amount << endl;
00051 }
00052 
00053 
00054 /*****************************************************************************/
00055 /* NULL BANKER                                                               */
00056 /*****************************************************************************/
00057 
00058 NullBanker::NullBanker(bool authorize)
00059     : authorize_(authorize)
00060 {
00061 }
00062 //----------------------------------------------------------------------
00063 bool
00064 NullBanker::
00065 authorizeBid(const AccountKey & account,
00066              const std::string & item,
00067              Amount amountToAuthorize)
00068 {
00069     return authorize_;
00070 }
00071 //----------------------------------------------------------------------
00072 void
00073 NullBanker::
00074 commitBid(const AccountKey & account,
00075           const std::string & item,
00076           Amount amountPaid,
00077           const LineItems & lineItems)
00078 {
00079 }
00080 
00081 //----------------------------------------------------------------------
00082 void
00083 NullBanker::
00084 forceWinBid(const AccountKey & account,
00085             Amount amountPaid,
00086             const LineItems & lineItems)
00087 {
00088 }
00089 
00090 #if 0
00091 //----------------------------------------------------------------------
00092 std::string NullBanker::getCampaignStatusStr(const std::string & campaign,
00093                                              const std::string &strategy) const
00094 {
00095     return "{}";
00096 }
00097 //----------------------------------------------------------------------
00098 Json::Value NullBanker::getCampaignStatusJson(const std::string & campaign,
00099         const std::string &strategy) const
00100 {
00101     return Json::Value();
00102 }
00103 //----------------------------------------------------------------------
00104 Json::Value NullBanker::dumpAllCampaignsJson() const
00105 {
00106     return Json::Value();
00107 }
00108 #endif
00109 #if 0
00110 //----------------------------------------------------------------------
00111 Banker::OutstandingStats
00112 NullBanker::
00113 totalOutstandingStats(const std::string & campaign,
00114                       const std::string & strategy) const
00115 {
00116     return OutstandingStats();
00117 }
00118 #endif
00119 
00120 } // namespace RTBKIT
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator