All pastes #24775 Raw Edit

Something

public text v1 · immutable
#24775 ·published 2005-10-07 00:12 UTC
rendered paste body
#pragma once

// Create Component Instances 
// Date: 9/05

// Get Components from the BigDev\cmpnts folder

#include "Record\Rec1.hpp"		// Record Template
#include "SMachine\SMach1.hpp"	// Sorting_Machine Template
#include "Queue\que1.hpp"		// Queue Template

// Create Country_Record
class Country_Class {
	public:
		Text country_name;
		Text continent_name;
		Float population_in_2001;
		Integer births_per_1000_population;
		Integer deaths_per_1000_population;
		Float rate_of_natural_increase_percentage;
		Float projected_population_change_2001_to_2050_percentage;
		Float projected_population_in_2025_millions;
		Float projected_population_in_2050_millions;
		Float infant_mortality_rate_per_1000_live_births;
		Float total_fertility_rate;
		Long_Integer area_of_country_in_square_miles;
		Integer population_density;
};
typedef Record_1 <Country_Class> Country_Record;

// Create Name_Comparer
// This class will be given to Sorting_Machine (below).
// Sorting_Machine will call the Name_Comparer::Are_Ordered 
// operation to compare to grade records for being in order
// relative to each other.
class Record_Comparer
{
public:
	static Boolean Are_Ordered (
			preserves Country_Record& lhs,
			preserves Country_Record& rhs
		)
	{
		return (lhs->country_name <= rhs->country_name);
	} // Are_Ordered
};

typedef Sorting_Machine_1 <Country_Record, Record_Comparer> Record_Sorter;

typedef Queue_1 <Country_Record> Record_Queue;