/* @(#)customer.cc (c) Telelogic AB */ #include #include "customer.h" #include "cardauth.h" #include "account.h" std::istream& operator>>(std::istream& f, CustomerEditEnum& choice) { int bufint; comment("\n\tChoice : ","\n\tChoix : \t"); std::cin >> bufint; // Conditions choice = (CustomerEditEnum) bufint; return f; } void Customer::GenInit() { Account = 0; CardAuthorization = 0; } Customer::Customer() { GenInit(); } Customer::Customer(const char* name, const char* address) { GenInit(); Name.SetStr(name); Address.SetStr(address); } std::ostream& operator<<(std::ostream& f, Customer& customer) { comment("\nCustomer :\n", "\nClient :\n"); comment("\tName : \t\t\t", "\tNom : \t\t\t"); std::cout<>(std::istream& f, Customer& customer) { CustomerEditEnum choice; std::cout<>choice; switch(choice) { case CUSTOMER_NAME_CHOICE: comment("\tName : \t", "\tNom : \t"); std::cin>>customer.Name; break; case CUSTOMER_ADDRESS_CHOICE: comment("\tAddress : \t", "Adresse : \t\t"); std::cin>>customer.Address; break; } std::cout<same_Customer); //GENB if (*p) *p = (*p) ->same_Customer; //GENB } //GENB void Customer::add_Account (class Account& a_Account) //GENB { //GENB p_connect_Account(a_Account); //GENB a_Account.p_connect_Customer(*this); //GENB } //GENB void Customer::rem_Account(class Account& a_Account) //GENB { //GENB p_disconnect_Account(a_Account); //GENB a_Account.p_disconnect_Customer(*this); //GENB } //GENB void Customer::p_connect_Account (class Account& a_Account) //GENB { //GENB a_Account.same_Customer = Account; //GENB Account = &a_Account; //GENB } //GENB void Customer::p_disconnect_Account(class Account& a_Account) //GENB { //GENB class Account **p; //GENB for (p = &Account; *p && *p != &a_Account; p = &(*p) ->same_Customer); //GENB if (*p) *p = (*p) ->same_Customer; //GENB } //GENB