vector_dist_key.hpp 1.01 KB
Newer Older
incardon's avatar
incardon committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
/*
 * vector_dist_key.hpp
 *
 *  Created on: Mar 10, 2015
 *      Author: i-bird
 */

#ifndef VECTOR_DIST_KEY_HPP_
#define VECTOR_DIST_KEY_HPP_



/*! \brief Grid key for a distributed grid
 *
 * Grid key for a distributed grid
 *
 */

class vect_dist_key_dx
{
	//! Local grid iterator

	size_t key;

public:

27 28
	/*! \brief set the key
	 *
incardon's avatar
incardon committed
29
	 * \param key the local key
30 31 32 33 34 35 36
	 *
	 */
	inline void setKey(size_t key)
	{
		this->key = key;
	}

incardon's avatar
incardon committed
37 38 39 40 41
	/*! \brief Get the key
	 *
	 * \return the local key
	 *
	 */
42
	inline size_t getKey() const
incardon's avatar
incardon committed
43 44 45 46
	{
		return key;
	}

incardon's avatar
incardon committed
47 48 49
	/*! \brief Convert the key into a string message
	 *
	 * \return a string message
50 51 52 53 54 55 56 57 58 59 60
	 *
	 */
	std::string to_string()
	{
		std::stringstream ts;

		ts << "x[0]=" << key;

		return ts.str();
	}

incardon's avatar
incardon committed
61
	//! constructor from a key
62
/*	inline vect_dist_key_dx(size_t key)
63
	:key(key)
incardon's avatar
incardon committed
64
	{
65
	}*/
66

incardon's avatar
incardon committed
67
	//! Default constructor
68 69
	inline vect_dist_key_dx()
	{
incardon's avatar
incardon committed
70
		/* coverity[uninit_member] */
71
	}
incardon's avatar
incardon committed
72 73 74 75 76 77

	//! Default constructor
	inline vect_dist_key_dx(size_t key)
	:key(key)
	{
	}
incardon's avatar
incardon committed
78 79 80 81 82
};



#endif /* VECTOR_DIST_KEY_HPP_ */