<commit_before>/*
 * Ubitrack - Library for Ubiquitous Tracking
 * Copyright 2006, Technische Universitaet Muenchen, and individual
 * contributors as indicated by the @authors tag. See the
 * copyright.txt in the distribution for a full listing of individual
 * contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

/**
 * @ingroup dataflow_framework
 * @file
 * Traits for event types. Can be specialized for other event types.
 * The traits tell for each type
 * - how the get the event queue priority
 * - the maximum queue length for events of that type
 *
 * @author <NAME> <<EMAIL>>
 */

#ifndef __Ubitrack_Dataflow_EventTypeTraits_INCLUDED__
#define __Ubitrack_Dataflow_EventTypeTraits_INCLUDED__

#include <utMeasurement/Timestamp.h>

namespace Ubitrack { namespace Dataflow {

/** default maximum queue length for all data types */
static const int g_defaultMaxQueueLength = 
#ifdef MAXIMUM_EVENTQUEUE_LENGTH
	MAXIMUM_EVENTQUEUE_LENGTH;
#else
	7; // 7 is the default, if not overriden by compiler options
#endif

/**
 * \internal
 * Defines how to extract the priority out of a data type.
 * By default, take the current time.
 */
template< typename T >
struct EventTypeTraits
{
	unsigned long long getPriority( const T& ) const
	{ return Measurement::now(); }

	int getMaxQueueLength() const
	{ return g_defaultMaxQueueLength; }
};

} } // namespace Ubitrack::Dataflow<commit_msg>small change to use the event timestamp for priority instead of the current time, not sure which side effects this might cause<commit_after>/*
 * Ubitrack - Library for Ubiquitous Tracking
 * Copyright 2006, Technische Universitaet Muenchen, and individual
 * contributors as indicated by the @authors tag. See the
 * copyright.txt in the distribution for a full listing of individual
 * contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

/**
 * @ingroup dataflow_framework
 * @file
 * Traits for event types. Can be specialized for other event types.
 * The traits tell for each type
 * - how the get the event queue priority
 * - the maximum queue length for events of that type
 *
 * @author <NAME> <<EMAIL>>
 */

#ifndef __Ubitrack_Dataflow_EventTypeTraits_INCLUDED__
#define __Ubitrack_Dataflow_EventTypeTraits_INCLUDED__

#include <utMeasurement/Timestamp.h>

namespace Ubitrack { namespace Dataflow {

/** default maximum queue length for all data types */
static const int g_defaultMaxQueueLength = 
#ifdef MAXIMUM_EVENTQUEUE_LENGTH
	MAXIMUM_EVENTQUEUE_LENGTH;
#else
	7; // 7 is the default, if not overriden by compiler options
#endif

/**
 * \internal
 * Defines how to extract the priority out of a data type.
 * By default, take the current time.
 */
template< typename T >
struct EventTypeTraits
{
	unsigned long long getPriority( const T& m) const
	//{ return Measurement::now(); }
	{ return m.time(); }

	int getMaxQueueLength() const
	{ return g_defaultMaxQueueLength; }
};

} } // namespace Ubitrack::Dataflow
{'fraction_non_alphanumeric': 0.07019536574284416, 'fraction_numerical': 0.008632439800090867, 'mean_word_length': 4.167840375586854, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2342068', 'n_tokens_mistral': 1230, 'n_tokens_neox': 1185, 'n_words': 563}