Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals

ofx_containers.hh

Go to the documentation of this file.
00001 /***************************************************************************
00002                           ofx_proc_rs.h 
00003                              -------------------
00004     copyright            : (C) 2002 by Benoit Grégoire
00005     email                : bock@step.polymtl.ca
00006 ***************************************************************************/
00013 /***************************************************************************
00014  *                                                                         *
00015  *   This program is free software; you can redistribute it and/or modify  *
00016  *   it under the terms of the GNU General Public License as published by  *
00017  *   the Free Software Foundation; either version 2 of the License, or     *
00018  *   (at your option) any later version.                                   *
00019  *                                                                         *
00020  ***************************************************************************/
00021 #ifndef OFX_PROC_H
00022 #define OFX_PROC_H
00023 #include "libofx.h"
00024 #include "tree.hh"
00025 using namespace std;
00026 
00031 class OfxGenericContainer {
00032  public:
00033   string type;
00034   string tag_identifier; 
00035   OfxGenericContainer *parentcontainer;
00036   
00037   OfxGenericContainer();
00038   OfxGenericContainer(OfxGenericContainer *para_parentcontainer);
00039   OfxGenericContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00040 
00041   virtual ~OfxGenericContainer(){};
00042   
00049   virtual void add_attribute(const string identifier, const string value);
00055   virtual int gen_event();
00056 
00062   virtual int add_to_main_tree();
00063 
00065     OfxGenericContainer* getparent();
00066 };//End class OfxGenericObject
00067 
00072 class OfxDummyContainer:public OfxGenericContainer {
00073  public:
00074   OfxDummyContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00075   void add_attribute(const string identifier, const string value);
00076 };
00077 
00082 class OfxPushUpContainer:public OfxGenericContainer {
00083  public:
00084   
00085   OfxPushUpContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00086   void add_attribute(const string identifier, const string value);
00087 };
00088 
00090 class OfxStatusContainer:public OfxGenericContainer {
00091  public:
00092   OfxStatusData data;
00093   
00094   OfxStatusContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00095   ~OfxStatusContainer();
00096   void add_attribute(const string identifier, const string value);
00097 };
00098 
00103 class OfxBalanceContainer:public OfxGenericContainer {
00104  public:
00105   /* Not yet complete see spec 1.6 p.63 */
00106   //char name[OFX_BALANCE_NAME_LENGTH];
00107   //char description[OFX_BALANCE_DESCRIPTION_LENGTH];
00108   //enum BalanceType{DOLLAR, PERCENT, NUMBER} balance_type;
00109   double amount; 
00110   int amount_valid;
00111   time_t date; 
00112   int date_valid;
00113   
00114   OfxBalanceContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00115   ~OfxBalanceContainer();
00116   void add_attribute(const string identifier, const string value);
00117 };
00118 
00119 /***************************************************************************
00120  *                          OfxStatementContainer                          *
00121  ***************************************************************************/
00126 class OfxStatementContainer:public OfxGenericContainer {
00127  public:
00128   OfxStatementData data;
00129   
00130   OfxStatementContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00131   ~OfxStatementContainer();
00132   void add_attribute(const string identifier, const string value);
00133   virtual int add_to_main_tree();
00134   virtual int gen_event();
00135   void add_account(OfxAccountData * account_data);
00136   void add_balance(OfxBalanceContainer* ptr_balance_container);
00137 //  void add_transaction(const OfxTransactionData transaction_data);
00138 
00139 };
00140 
00141 /***************************************************************************
00142  *                           OfxAccountContaine r                          *
00143  ***************************************************************************/
00148 class OfxAccountContainer:public OfxGenericContainer {
00149  public:
00150   OfxAccountData data;
00151   
00152   OfxAccountContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00153   ~OfxAccountContainer();
00154   void add_attribute(const string identifier, const string value);
00155   int add_to_main_tree();
00156   virtual int gen_event();
00157  private:
00158   void gen_account_id(void);
00159   char bankid[OFX_BANKID_LENGTH];
00160   char branchid[OFX_BRANCHID_LENGTH];
00161   char acctid[OFX_ACCTID_LENGTH];
00162   char acctkey[OFX_ACCTKEY_LENGTH];
00163   char brokerid[OFX_BROKERID_LENGTH];
00164 };
00165 
00166 /***************************************************************************
00167  *                           OfxSecurityContainer                          *
00168  ***************************************************************************/
00171 class OfxSecurityContainer:public OfxGenericContainer {
00172  public:
00173   OfxSecurityData data;  
00174 
00175   OfxSecurityContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00176   ~OfxSecurityContainer();
00177   void add_attribute(const string identifier, const string value);
00178   virtual int gen_event();
00179   virtual int add_to_main_tree();
00180  private:
00181   OfxStatementContainer * parent_statement;
00182 };
00183 
00184 
00185 /***************************************************************************
00186  *                        OfxTransactionContainer                          *
00187  ***************************************************************************/
00190 class OfxTransactionContainer:public OfxGenericContainer {
00191  public:
00192   OfxTransactionData data;  
00193 
00194   OfxTransactionContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00195   ~OfxTransactionContainer();
00196   virtual void add_attribute(const string identifier, const string value);
00197   void add_account(OfxAccountData * account_data);
00198 
00199   virtual int gen_event();
00200   virtual int add_to_main_tree();
00201  private:
00202   OfxStatementContainer * parent_statement;
00203 };
00204 
00209 class OfxBankTransactionContainer:public OfxTransactionContainer {
00210  public:
00211   OfxBankTransactionContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00212   void add_attribute(const string identifier, const string value);
00213 };
00214 
00219 class OfxInvestmentTransactionContainer:public OfxTransactionContainer {
00220  public:
00221   OfxInvestmentTransactionContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00222 
00223   void add_attribute(const string identifier, const string value);
00224 };
00225 
00226 /***************************************************************************
00227  *                             OfxMainContainer                            *
00228  ***************************************************************************/
00233 class OfxMainContainer:public OfxGenericContainer {
00234 public:
00235   OfxMainContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00236   ~OfxMainContainer();
00237   int add_container(OfxGenericContainer * container);
00238   int add_container(OfxStatementContainer * container);
00239   int add_container(OfxAccountContainer * container);
00240   int add_container(OfxTransactionContainer * container);
00241   int add_container(OfxSecurityContainer * container);
00242   int gen_event();
00243   OfxSecurityData * find_security(string unique_id);
00244 private:
00245   tree<OfxGenericContainer *> security_tree;
00246   tree<OfxGenericContainer *> account_tree;
00247 };
00248 
00249 
00250 #endif

Generated on Fri Sep 12 00:35:46 2003 for LibOFX by doxygen 1.3.3