Click here to Skip to main content
15,894,955 members
Articles / Programming Languages / Objective C

Specialized Visitor Design for Segregating Traversal (Criteria Based) and Operation

Rate me:
Please Sign up or sign in to vote.
4.67/5 (3 votes)
27 Dec 2012CPOL3 min read 12.4K   73   5  
Hide the internal data structure's complexity by segregating traversal and operations
#include <string>
#pragma once

using namespace std;
class Account
{
public:

	Account(void)
		: _acountNum("")
		, _balance(0)
		, _pin(0)
	{
	}

	virtual ~Account(void)
	{
	}

private:
	string _acountNum;
	double _balance;
	int _pin;

public:
	string getAccountNum() { return _acountNum; }
	double getBalance() { return _balance; }
	int getPin() { return _pin; }

	void setAccountNum(string accntNum) { _acountNum = accntNum; }
	void setBalance(double balance) { _balance = balance; }
	void setPin(int pin) { _pin = pin; }
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
India India
My name is Mitendra Anand and my work is focused around application development which includes a lot of prototyping of new solutions.

While I have a background in C++/VC++ programming, my daily work is mostly spent in C++, Sybase, SQL, Unix/Windows.

Comments and Discussions