repo_name
stringlengths 6
101
| path
stringlengths 4
300
| text
stringlengths 7
1.31M
|
|---|---|---|
BinmingWen/base-code
|
Exception And Thread/src/Exception/AuctionException.java
|
package Exception;
public class AuctionException extends Exception{
public AuctionException(){}
public AuctionException(String s){
super(s);
}
}
|
DirectXceriD/gridgain
|
modules/ml/src/main/java/org/apache/ignite/ml/composition/boosting/convergence/median/MedianOfMedianConvergenceChecker.java
|
<reponame>DirectXceriD/gridgain
/*
* GridGain Community Edition Licensing
* Copyright 2019 GridGain Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License") modified with Commons Clause
* Restriction; you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*
* Commons Clause Restriction
*
* The Software is provided to you by the Licensor under the License, as defined below, subject to
* the following condition.
*
* Without limiting other conditions in the License, the grant of rights under the License will not
* include, and the License does not grant to you, the right to Sell the Software.
* For purposes of the foregoing, โSellโ means practicing any or all of the rights granted to you
* under the License to provide to third parties, for a fee or other consideration (including without
* limitation fees for hosting or consulting/ support services related to the Software), a product or
* service whose value derives, entirely or substantially, from the functionality of the Software.
* Any license notice or attribution required by the License must also include this Commons Clause
* License Condition notice.
*
* For purposes of the clause above, the โLicensorโ is Copyright 2019 GridGain Systems, Inc.,
* the โLicenseโ is the Apache License, Version 2.0, and the Software is the GridGain Community
* Edition software provided with this notice.
*/
package org.apache.ignite.ml.composition.boosting.convergence.median;
import java.util.Arrays;
import org.apache.ignite.ml.composition.ModelsComposition;
import org.apache.ignite.ml.composition.boosting.convergence.ConvergenceChecker;
import org.apache.ignite.ml.composition.boosting.loss.Loss;
import org.apache.ignite.ml.dataset.Dataset;
import org.apache.ignite.ml.dataset.DatasetBuilder;
import org.apache.ignite.ml.dataset.primitive.FeatureMatrixWithLabelsOnHeapData;
import org.apache.ignite.ml.dataset.primitive.context.EmptyContext;
import org.apache.ignite.ml.math.functions.IgniteBiFunction;
import org.apache.ignite.ml.math.functions.IgniteFunction;
import org.apache.ignite.ml.math.primitives.vector.Vector;
import org.apache.ignite.ml.math.primitives.vector.VectorUtils;
/**
* Use median of median on partitions value of errors for estimating error on dataset. This algorithm may be less
* sensitive to
*
* @param <K> Type of a key in upstream data.
* @param <V> Type of a value in upstream data.
*/
public class MedianOfMedianConvergenceChecker<K, V> extends ConvergenceChecker<K, V> {
/** Serial version uid. */
private static final long serialVersionUID = 4902502002933415287L;
/**
* Creates an instance of MedianOfMedianConvergenceChecker.
*
* @param sampleSize Sample size.
* @param lblMapping External label to internal mapping.
* @param loss Loss function.
* @param datasetBuilder Dataset builder.
* @param fExtr Feature extractor.
* @param lbExtr Label extractor.
* @param precision Precision.
*/
public MedianOfMedianConvergenceChecker(long sampleSize, IgniteFunction<Double, Double> lblMapping, Loss loss,
DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> fExtr,
IgniteBiFunction<K, V, Double> lbExtr, double precision) {
super(sampleSize, lblMapping, loss, datasetBuilder, fExtr, lbExtr, precision);
}
/** {@inheritDoc} */
@Override public Double computeMeanErrorOnDataset(Dataset<EmptyContext, ? extends FeatureMatrixWithLabelsOnHeapData> dataset,
ModelsComposition mdl) {
double[] medians = dataset.compute(
data -> computeMedian(mdl, data),
this::reduce
);
if(medians == null)
return Double.POSITIVE_INFINITY;
return getMedian(medians);
}
/**
* Compute median value on data partition.
*
* @param mdl Model.
* @param data Data.
* @return median value.
*/
private double[] computeMedian(ModelsComposition mdl, FeatureMatrixWithLabelsOnHeapData data) {
double[] errors = new double[data.getLabels().length];
for (int i = 0; i < errors.length; i++)
errors[i] = Math.abs(computeError(VectorUtils.of(data.getFeatures()[i]), data.getLabels()[i], mdl));
return new double[] {getMedian(errors)};
}
/**
* Compute median value on array of errors.
*
* @param errors Error values.
* @return median value of errors.
*/
private double getMedian(double[] errors) {
if(errors.length == 0)
return Double.POSITIVE_INFINITY;
Arrays.sort(errors);
final int middleIdx = (errors.length - 1) / 2;
if (errors.length % 2 == 1)
return errors[middleIdx];
else
return (errors[middleIdx + 1] + errors[middleIdx]) / 2;
}
/**
* Merge median values among partitions.
*
* @param left Left partition.
* @param right Right partition.
* @return merged median values.
*/
private double[] reduce(double[] left, double[] right) {
if (left == null)
return right;
if(right == null)
return left;
double[] res = new double[left.length + right.length];
System.arraycopy(left, 0, res, 0, left.length);
System.arraycopy(right, 0, res, left.length, right.length);
return res;
}
}
|
Reclusive-Trader/upbit-client
|
swg_generated/cpp/cpprest/model/MarketInfo.h
|
<reponame>Reclusive-Trader/upbit-client<gh_stars>10-100
/**
* Upbit Open API
* ## REST API for Upbit Exchange - Base URL: [https://api.upbit.com] - Official Upbit API Documents: [https://docs.upbit.com] - Official Support email: [<EMAIL>]
*
* OpenAPI spec version: 1.0.0
* Contact: <EMAIL>
*
* NOTE: This class is auto generated by the swagger code generator 2.4.18.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/*
* MarketInfo.h
*
*
*/
#ifndef IO_SWAGGER_CLIENT_MODEL_MarketInfo_H_
#define IO_SWAGGER_CLIENT_MODEL_MarketInfo_H_
#include "../ModelBase.h"
#include <cpprest/details/basic_types.h>
namespace io {
namespace swagger {
namespace client {
namespace model {
/// <summary>
///
/// </summary>
class MarketInfo
: public ModelBase
{
public:
MarketInfo();
virtual ~MarketInfo();
/////////////////////////////////////////////
/// ModelBase overrides
void validate() override;
web::json::value toJson() const override;
void fromJson(web::json::value& json) override;
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
/////////////////////////////////////////////
/// MarketInfo members
/// <summary>
/// ์
๋นํธ์์ ์ ๊ณต์ค์ธ ์์ฅ ์ ๋ณด
/// </summary>
utility::string_t getMarket() const;
bool marketIsSet() const;
void unsetMarket();
void setMarket(utility::string_t value);
/// <summary>
/// ๊ฑฐ๋ ๋์ ์ํธํํ ํ๊ธ๋ช
/// </summary>
utility::string_t getKoreanName() const;
bool koreanNameIsSet() const;
void unsetKorean_name();
void setKoreanName(utility::string_t value);
/// <summary>
/// ๊ฑฐ๋ ๋์ ์ํธํํ ์๋ฌธ๋ช
/// </summary>
utility::string_t getEnglishName() const;
bool englishNameIsSet() const;
void unsetEnglish_name();
void setEnglishName(utility::string_t value);
/// <summary>
/// ์ ์ ์ข
๋ชฉ ์ฌ๋ถ - NONE (ํด๋น ์ฌํญ ์์) - CAUTION (ํฌ์์ ์)
/// </summary>
utility::string_t getMarketWarning() const;
bool marketWarningIsSet() const;
void unsetMarket_warning();
void setMarketWarning(utility::string_t value);
protected:
utility::string_t m_Market;
bool m_MarketIsSet;
utility::string_t m_Korean_name;
bool m_Korean_nameIsSet;
utility::string_t m_English_name;
bool m_English_nameIsSet;
utility::string_t m_Market_warning;
bool m_Market_warningIsSet;
};
}
}
}
}
#endif /* IO_SWAGGER_CLIENT_MODEL_MarketInfo_H_ */
|
liov/tiga
|
utils/net/http/api/graphql/scalar.go
|
package gql
import (
"errors"
"strconv"
)
type Uint64 uint64
func (Uint64) ImplementsGraphQLType(name string) bool {
return name == "Uint64"
}
func (i *Uint64) UnmarshalGraphQL(input interface{}) error {
var err error
switch input := input.(type) {
case uint64:
*i = Uint64(input)
case int64:
*i = Uint64(input)
case int:
*i = Uint64(input)
case uint32:
*i = Uint64(input)
case int32:
*i = Uint64(input)
case uint:
*i = Uint64(input)
default:
err = errors.New("wrong type")
}
return err
}
func (i Uint64) MarshalJSON() ([]byte, error) {
return strconv.AppendInt(nil, int64(i), 10), nil
}
type Uint32 uint64
func (Uint32) ImplementsGraphQLType(name string) bool {
return name == "Uint32"
}
func (i *Uint32) UnmarshalGraphQL(input interface{}) error {
var err error
switch input := input.(type) {
case uint64:
*i = Uint32(input)
case int64:
*i = Uint32(input)
case int:
*i = Uint32(input)
case uint32:
*i = Uint32(input)
case int32:
*i = Uint32(input)
case uint:
*i = Uint32(input)
default:
err = errors.New("wrong type")
}
return err
}
func (i Uint32) MarshalJSON() ([]byte, error) {
return strconv.AppendInt(nil, int64(i), 10), nil
}
|
forsakenyang/xLua
|
build/ai/weiqi/move_reasons.h
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* This is GNU Go, a Go program. Contact <EMAIL>, or see *
* http://www.gnu.org/software/gnugo/ for more information. *
* *
* Copyright 1999, 2000, 2001, 2002, 2003 and 2004 *
* by the Free Software Foundation. *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation - version 2 *
* *
* This program 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 General Public License in file COPYING for more details. *
* *
* You should have received a copy of the GNU General Public *
* License along with this program; if not, write to the Free *
* Software Foundation, Inc., 59 Temple Place - Suite 330, *
* Boston, MA 02111, USA. *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//* values for move_reason.type */#define THREAT_BIT 1
/* Only use even values for non-threat move reasons! */
#define ATTACK_MOVE 2
#define ATTACK_MOVE_GOOD_KO 4
#define ATTACK_MOVE_BAD_KO 6
#define ATTACK_THREAT (ATTACK_MOVE | THREAT_BIT)
#define DEFEND_MOVE 8
#define DEFEND_MOVE_GOOD_KO 10
#define DEFEND_MOVE_BAD_KO 12
#define DEFEND_THREAT (DEFEND_MOVE | THREAT_BIT)
#define CONNECT_MOVE 14
#define CUT_MOVE 16
#define SEMEAI_MOVE 18
#define SEMEAI_THREAT (SEMEAI_MOVE | THREAT_BIT)
/* BLOCK_TERRITORY_MOVE 20 OBSOLETE */
#define EXPAND_TERRITORY_MOVE 20
#define EXPAND_MOYO_MOVE 22
#define INVASION_MOVE 24
#define OWL_ATTACK_MOVE 26
#define OWL_ATTACK_MOVE_GOOD_KO 28
#define OWL_ATTACK_MOVE_BAD_KO 30
#define OWL_ATTACK_THREAT (OWL_ATTACK_MOVE | THREAT_BIT)
#define OWL_DEFEND_MOVE 32
#define OWL_DEFEND_MOVE_GOOD_KO 34
#define OWL_DEFEND_MOVE_BAD_KO 36
#define OWL_DEFEND_THREAT (OWL_DEFEND_MOVE | THREAT_BIT)
#define OWL_PREVENT_THREAT 38
#define UNCERTAIN_OWL_ATTACK 40
#define UNCERTAIN_OWL_DEFENSE 42
#define STRATEGIC_ATTACK_MOVE 44
#define STRATEGIC_DEFEND_MOVE 46
#define MY_ATARI_ATARI_MOVE 50
#define YOUR_ATARI_ATARI_MOVE 52
#define VITAL_EYE_MOVE 54
#define OWL_ATTACK_MOVE_GAIN 60
#define OWL_DEFEND_MOVE_LOSS 62
#define ANTISUJI_MOVE 70
#define EITHER_MOVE 100
#define ALL_MOVE 102
/* Bitmap values for move_reason.status */
#define ACTIVE 0
#define TERRITORY_REDUNDANT 1
#define STRATEGICALLY_REDUNDANT 2
#define REDUNDANT (TERRITORY_REDUNDANT | STRATEGICALLY_REDUNDANT)
#define SECONDARY 4
#define MAX_REASONS 120
#define MAX_TRACE_LENGTH 160
#define HUGE_MOVE_VALUE 10.0*MAX_BOARD*MAX_BOARD
struct move_reason {
int type; /* e.g. attack, defend, or connect */
int what; /* pointer into list of strings, list of pair of dragons,
or similar */
int status; /* This is a bitmap to mark redundant or secondary
move reasons. */
};
struct move_data {
float value; /* total comparison value, computed at the very end */
float final_value; /* value after point redistribution. */
float additional_ko_value; /* Additional threat value if ko fight going on.*/
float territorial_value; /* Value in terms of actual profit. */
float strategical_value; /* Value with respect to strength, weakness, and
safety of all groups on the board. */
float maxpos_shape; /* Maximal positive contribution to shape */
float maxneg_shape; /* Maximal negative contribution to shape */
int numpos_shape; /* Number of positive contributions to shape */
int numneg_shape; /* Number of negative contributions to shape */
float followup_value; /* Value of followup move (our sente). */
float influence_followup_value; /* Followup value of move as reported by
experimental influence. */
float reverse_followup_value; /* Value of opponents followup move
(reverse sente). */
float secondary_value; /* Secondary move value. */
float min_value; /* Minimum allowed value for the move. */
float max_value; /* Maximum allowed value for the move. */
float min_territory; /* Minimum territorial value. */
float max_territory; /* Maximum territorial value. */
float randomness_scaling; /* Increase to randomize this move. */
int reason[MAX_REASONS]; /* List of reasons for a move. */
int move_safety; /* Whether the move seems safe. */
int worthwhile_threat; /* Play this move as a pure threat. */
float random_number; /* Random number connected to this move. */
};
/*
* Some sizes.
*
* FIXME: Many of these could be optimized more for size (e.g. MAX_EYES)
*/
#define MAX_MOVE_REASONS 1000
#define MAX_WORMS 2*MAX_BOARD*MAX_BOARD/3
#define MAX_DRAGONS MAX_WORMS
#define MAX_CONNECTIONS 4*MAX_WORMS
#define MAX_EYES MAX_BOARD*MAX_BOARD/2
#define MAX_LUNCHES MAX_WORMS
#define MAX_EITHER 100
#define MAX_ALL 100
#define MAX_ATTACK_THREATS 6
extern struct move_data move[BOARDMAX];
extern struct move_reason move_reasons[MAX_MOVE_REASONS];
extern int next_reason;
/* Connections */
extern int conn_worm1[MAX_CONNECTIONS];
extern int conn_worm2[MAX_CONNECTIONS];
extern int next_connection;
/* Unordered sets (currently pairs) of move reasons / targets */
typedef struct {
int reason1;
int what1;
int reason2;
int what2;
} Reason_set;
extern Reason_set either_data[MAX_EITHER];
extern int next_either;
extern Reason_set all_data[MAX_ALL];
extern int next_all;
/* Eye shapes */
extern int eyes[MAX_EYES];
extern int eyecolor[MAX_EYES];
extern int next_eye;
/* Lunches */
extern int lunch_dragon[MAX_LUNCHES]; /* eater */
extern int lunch_worm[MAX_LUNCHES]; /* food */
extern int next_lunch;
/* Point redistribution */
extern int replacement_map[BOARDMAX];
/* The color for which we are evaluating moves. */
extern int current_color;
int find_worm(int str);
int find_dragon(int str);
int move_reason_known(int pos, int type, int what);
int attack_move_reason_known(int pos, int what);
int defense_move_reason_known(int pos, int what);
int owl_attack_move_reason_known(int pos, int what);
int owl_defense_move_reason_known(int pos, int what);
int owl_move_reason_known(int pos, int what);
int semeai_move_reason_known(int pos, int what);
int get_biggest_owl_target(int pos);
int is_antisuji_move(int pos);
void discard_redundant_move_reasons(int pos);
void mark_changed_dragon(int pos, int color, int affected, int affected2,
int move_reason_type, char safe_stones[BOARDMAX],
float strength[BOARDMAX], float *effective_size);
void mark_changed_string(int affected, char changed_stones[BOARDMAX],
float strength[BOARDMAX], char new_status);
int adjacent_to_nondead_stone(int pos, int color);
int find_connection(int worm1, int worm2);
/*
* Local Variables:
* tab-width: 8
* c-basic-offset: 2
* End:
*/
|
davidlukerice/genSynth
|
app/app/routes/application.js
|
import Ember from 'ember';
import config from '../config/environment';
import analytics from 'gen-synth/mixins/analytics-handler';
export default Ember.Route.extend(analytics, {
beforeModel: function() {
this._super();
var self = this;
Ember.A([
'sessionAuthenticationSucceeded',
'sessionAuthenticationFailed',
'sessionInvalidationSucceeded',
'sessionInvalidationFailed',
'authorizationFailed'
]).forEach(function(event) {
self.get('session').on(event, function() {
Array.prototype.unshift.call(arguments, event);
self.send.apply(self, arguments);
});
});
},
actions: {
authenticate: function(options) {
this.get('session').authenticate(
'simple-auth-authenticator:torii',
options);
},
invalidateSession: function() {
var self = this;
Ember.$.ajax({
url: config.apiUrl+'/auth/logout',
type: 'GET',
xhrFields: {
withCredentials: true
}
}).then(function() {
self.get('session').invalidate();
self.transitionTo('index').then(function() {
location.reload();
});
});
},
sessionAuthenticationSucceeded: function(){
console.log('sessionAuthenticationSucceeded: route');
this.get('controller').send('hideLogin');
}.on('sessionAuthenticationSucceeded'),
sessionAuthenticationFailed: function(error) {
console.log('sessionAuthenticationFailed: route: '+error.message);
},
sessionInvalidationSucceeded: function() {
console.log('sessionInvalidationSucceeded: route');
},
sessionInvalidationFailed: function(error) {
console.log('sessionInvalidationFailed: route: '+error.message);
},
authorizationFailed: function() {
console.log('authorizationFailed: route');
},
makeLive: function(instrument) {
this.controllerFor('application')
.send('makeLive', instrument);
},
toggleHelp: function() {
this.controllerFor('application')
.send('toggleHelp');
}
}
});
|
tjhart/swivel
|
swivel-server/src/test/webapp/js/EditStubControllerTest.js
|
<filename>swivel-server/src/test/webapp/js/EditStubControllerTest.js
"use strict";
define(['test/lib/Squire', 'jQuery', 'jsHamcrest', 'jsMockito'], function (Squire, $, jsHamcrest, jsMockito) {
var injector = new Squire(), mockUtils = {};
jsHamcrest.Integration.QUnit();
jsMockito.Integration.QUnit();
injector
.mock('utils', mockUtils)
.require(['EditStubController'], function (EditStubController) {
module('EditStubController tests', {
setup: function () {
var that = this;
this.query = {};
this.mockSwivelServer = {
getStubs: mockFunction(),
editStub: mockFunction(),
addStub: mockFunction()
};
this.mockView = {setStub: mockFunction()};
mockUtils.getQuery = mockFunction('getQuery', function () {return that.query;});
}
});
test('init retrieves stub if query.id provided', 0, function () {
this.query.id = '1';
new EditStubController(this.mockSwivelServer, this.mockView);
verify(this.mockSwivelServer.getStubs)(this.query, typeOf('function'));
});
test('getStubCallback defers to setStub on view', 0, function () {
var getStubsCallback;
this.query = {id: '1', path: 'some/path'};
when(this.mockSwivelServer.getStubs)(anything(), typeOf('function'))
.then(function (query, callback) {
getStubsCallback = callback;
});
new EditStubController(this.mockSwivelServer, this.mockView);
getStubsCallback(['expected stub']);
verify(this.mockView.setStub)(this.query.path, 'expected stub');
});
//The functionality works - can't get the tests to work, for some reason.
// test('controller defers to server on edit stub', 0, function () {
// var data = {};
// new EditStubController(this.mockSwivelServer, this.mockView);
// $(this.mockView).trigger('edit-stub.swivelView', data);
//
// verify(this.mockSwivelServer.editStub)(data, typeOf('function'));
// });
//
// test('controller defers to server on add-stub.swivelView', 0, function () {
// var data = {};
// new EditStubController(this.mockSwivelServer, this.mockView);
// $(this.mockView).trigger('add-stub.swivelView', data);
//
// verify(this.mockSwivelServer.addStub)(data, typeOf('function'));
// });
});
});
|
eewiki/CY8CKIT-062-BLE
|
CY8CKIT-062-BLE/BLE Weather Station.cydsn/Generated_Source/PSoC6/pdl/middleware/ble/cy_ble_lns.h
|
/***************************************************************************//**
* \file cy_ble_lns.h
* \version 1.0
*
* \brief
* This file contains the function prototypes and constants used in
* the Location And Navigation Service of the BLE Component.
*
********************************************************************************
* \copyright
* Copyright 2017, Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
#ifndef CY_BLE_LNS_H
#define CY_BLE_LNS_H
#include "cy_ble_gatt.h"
#if (CY_BLE_MODE_PROFILE && defined(CY_BLE_LNS))
/* C binding of definitions if building with C++ compiler */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define CY_BLE_LNS_FLAG_PROCESS (0x01u)
/**
* \addtogroup group_ble_service_api_LNS_definitions
* @{
*/
/***************************************
* Data Types
***************************************/
/** LNS Service Characteristics indexes */
typedef enum
{
CY_BLE_LNS_FT, /**< Location and Navigation Feature characteristic index */
CY_BLE_LNS_LS, /**< Location and Speed characteristic index */
CY_BLE_LNS_PQ, /**< Position Quality characteristic index */
CY_BLE_LNS_CP, /**< Location and Navigation Control Point characteristic index */
CY_BLE_LNS_NV, /**< Navigation characteristic index */
CY_BLE_LNS_CHAR_COUNT /**< Total count of LNS characteristics */
}cy_en_ble_lns_char_index_t;
/** LNS Service Characteristic Descriptors indexes */
typedef enum
{
CY_BLE_LNS_CCCD, /**< Client Characteristic Configuration descriptor index */
CY_BLE_LNS_DESCR_COUNT /**< Total count of LNS descriptors */
}cy_en_ble_lns_descr_index_t;
/** Location and Navigation Server Characteristic structure type */
typedef struct
{
cy_ble_gatt_db_attr_handle_t charHandle; /**< Handle of characteristic value */
cy_ble_gatt_db_attr_handle_t descrHandle[CY_BLE_LNS_DESCR_COUNT]; /**< Handle of descriptor */
}cy_stc_ble_lnss_char_t;
/** Structure with Location and Navigation Service attribute handles */
typedef struct
{
/** Location and Navigation Service handle*/
cy_ble_gatt_db_attr_handle_t serviceHandle;
/** Location and Navigation Service characteristics info array */
cy_stc_ble_lnss_char_t charInfo[CY_BLE_LNS_CHAR_COUNT];
} cy_stc_ble_lnss_t;
/** Location and Navigation Client Characteristic structure type */
typedef struct
{
/** Properties for value field */
uint8_t properties;
/** Handle of server database attribute value entry */
cy_ble_gatt_db_attr_handle_t valueHandle;
/** Location and Navigation client char. descriptor handle */
cy_ble_gatt_db_attr_handle_t descrHandle[CY_BLE_LNS_DESCR_COUNT];
/** Characteristic End Handle */
cy_ble_gatt_db_attr_handle_t endHandle;
}cy_stc_ble_lnsc_char_t;
/** Structure with discovered attributes information of Location and Navigation Service */
typedef struct
{
cy_stc_ble_lnsc_char_t charInfo[CY_BLE_LNS_CHAR_COUNT]; /**< Characteristics handle + properties array */
}cy_stc_ble_lnsc_t;
/** LNS Characteristic Value parameter structure */
typedef struct
{
cy_stc_ble_conn_handle_t connHandle; /**< Peer device handle */
cy_en_ble_lns_char_index_t charIndex; /**< Index of service characteristic */
cy_stc_ble_gatt_value_t *value; /**< Characteristic value */
} cy_stc_ble_lns_char_value_t;
/** LNS Characteristic Descriptor Value parameter structure */
typedef struct
{
cy_stc_ble_conn_handle_t connHandle; /**< Peer device handle */
cy_en_ble_lns_char_index_t charIndex; /**< Index of service characteristic */
cy_en_ble_lns_descr_index_t descrIndex; /**< Index of service characteristic descriptor */
cy_stc_ble_gatt_value_t *value; /**< Descriptor value */
} cy_stc_ble_lns_descr_value_t;
/** Service configuration structure */
typedef struct
{
/** Location and Navigation GATT DB handles structure */
const cy_stc_ble_lnss_t *lnss;
/** An application layer event callback function to receive service events from the BLE Component. */
cy_ble_callback_t callbackFunc;
} cy_stc_ble_lns_config_t;
/** @}
** Service configuration structure
*/
/***************************************
* Function Prototypes
***************************************/
/**
* \addtogroup group_ble_service_api_LNS_server_client
* @{
*/
cy_en_ble_api_result_t Cy_BLE_LNS_Init(cy_stc_ble_lns_config_t *config);
cy_en_ble_api_result_t Cy_BLE_LNS_RegisterAttrCallback(cy_ble_callback_t callbackFunc);
/** @} */
#ifdef CY_BLE_LNS_SERVER
/**
* \addtogroup group_ble_service_api_LNS_server
* @{
*/
cy_en_ble_api_result_t Cy_BLE_LNSS_SetCharacteristicValue(cy_en_ble_lns_char_index_t charIndex,
uint8_t attrSize, uint8_t *attrValue);
cy_en_ble_api_result_t Cy_BLE_LNSS_GetCharacteristicValue(cy_en_ble_lns_char_index_t charIndex,
uint8_t attrSize, uint8_t *attrValue);
cy_en_ble_api_result_t Cy_BLE_LNSS_GetCharacteristicDescriptor(cy_stc_ble_conn_handle_t connHandle,
cy_en_ble_lns_char_index_t charIndex,
cy_en_ble_lns_descr_index_t descrIndex,
uint8_t attrSize, uint8_t *attrValue);
cy_en_ble_api_result_t Cy_BLE_LNSS_SendNotification(cy_stc_ble_conn_handle_t connHandle,
cy_en_ble_lns_char_index_t charIndex, uint8_t attrSize,
uint8_t *attrValue);
cy_en_ble_api_result_t Cy_BLE_LNSS_SendIndication(cy_stc_ble_conn_handle_t connHandle,
cy_en_ble_lns_char_index_t charIndex, uint8_t attrSize,
uint8_t *attrValue);
/** @} */
#endif /* CY_BLE_LNS_SERVER */
#ifdef CY_BLE_LNS_CLIENT
/**
* \addtogroup group_ble_service_api_LNS_client
* @{
*/
cy_en_ble_api_result_t Cy_BLE_LNSC_SetCharacteristicValue(cy_stc_ble_conn_handle_t connHandle,
cy_en_ble_lns_char_index_t charIndex, uint8_t attrSize,
uint8_t *attrValue);
cy_en_ble_api_result_t Cy_BLE_LNSC_GetCharacteristicValue(cy_stc_ble_conn_handle_t connHandle,
cy_en_ble_lns_char_index_t charIndex);
cy_en_ble_api_result_t Cy_BLE_LNSC_SetCharacteristicDescriptor(cy_stc_ble_conn_handle_t connHandle,
cy_en_ble_lns_char_index_t charIndex,
cy_en_ble_lns_descr_index_t descrIndex,
uint8_t attrSize, uint8_t *attrValue);
cy_en_ble_api_result_t Cy_BLE_LNSC_GetCharacteristicDescriptor(cy_stc_ble_conn_handle_t connHandle,
cy_en_ble_lns_char_index_t charIndex,
cy_en_ble_lns_descr_index_t descrIndex);
/** @} */
#endif /* CY_BLE_LNS_CLIENT */
/* Internal macros */
#ifdef CY_BLE_LNS_SERVER
#define CY_BLE_LNS_IS_PQ_SUPPORTED \
(CY_BLE_GATT_INVALID_ATTR_HANDLE_VALUE != cy_ble_lnsConfigPtr->lnss->charInfo[CY_BLE_LNS_PQ].charHandle)
#define CY_BLE_LNS_IS_CP_SUPPORTED \
(CY_BLE_GATT_INVALID_ATTR_HANDLE_VALUE != cy_ble_lnsConfigPtr->lnss->charInfo[CY_BLE_LNS_CP].charHandle)
#define CY_BLE_LNS_IS_NV_SUPPORTED \
(CY_BLE_GATT_INVALID_ATTR_HANDLE_VALUE != cy_ble_lnsConfigPtr->lnss->charInfo[CY_BLE_LNS_NV].charHandle)
#define CY_BLE_LNS_IS_PROCEDURE_IN_PROGRESS \
(0u != (CY_BLE_LNS_FLAG_PROCESS & cy_ble_lnsFlag))
#endif /* CY_BLE_LNS_SERVER */
#ifdef CY_BLE_LNS_CLIENT
#define Cy_BLE_LNSC_GetCharacteristicValueHandle(connHandle, charIndex) \
(((charIndex) >= CY_BLE_LNS_CHAR_COUNT) ? \
CY_BLE_GATT_INVALID_ATTR_HANDLE_VALUE : \
cy_ble_lnsc[Cy_BLE_GetDiscoveryIdx(connHandle)].charInfo[charIndex].valueHandle)
#define Cy_BLE_LNSC_GetCharacteristicDescriptorHandle(connHandle, charIndex, descrIndex) \
((((charIndex) >= CY_BLE_LNS_CHAR_COUNT) || ((descrIndex) >= CY_BLE_LNS_DESCR_COUNT)) ? \
CY_BLE_GATT_INVALID_ATTR_HANDLE_VALUE : \
cy_ble_lnsc[Cy_BLE_GetDiscoveryIdx(connHandle)].charInfo[charIndex].descrHandle[descrIndex])
#endif /* (CY_BLE_LNS_CLIENT) */
/** \endcond */
/***************************************
* External data references
***************************************/
#ifdef CY_BLE_LNS_SERVER
/* Location and Navigation Service GATT DB handles structure */
extern uint8_t cy_ble_lnsFlag;
#endif /* CY_BLE_LNSC_SERVER */
#ifdef CY_BLE_LNS_CLIENT
/* Location and Navigation Service server's GATT DB handles structure */
extern cy_stc_ble_lnsc_t cy_ble_lnsc[CY_BLE_CONFIG_GATTC_COUNT];
#endif /* CY_BLE_LNS_CLIENT */
extern cy_stc_ble_lns_config_t cy_ble_lnsConfig;
extern cy_stc_ble_lns_config_t *cy_ble_lnsConfigPtr;
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* CY_BLE_MODE_PROFILE && defined(CY_BLE_LNS) */
#endif /* CY_BLE_LNS_H */
/* [] END OF FILE */
|
NiklasRosenstein/slap
|
src/slap/ext/application/test.py
|
import logging
import os
import typing as t
from pathlib import Path
from nr.util.singleton import NotSet
from slap.application import IO, Application, argument, option
from slap.ext.application.venv import VenvAwareCommand
from slap.plugins import ApplicationPlugin
from slap.project import Project
logger = logging.getLogger(__name__)
class TestRunner:
_colors = ["blue", "cyan", "magenta", "yellow"]
_prev_color: t.ClassVar[str | None] = None
def __init__(self, name: str, config: t.Any, io: IO, cwd: Path | None = None, line_prefixing: bool = True) -> None:
assert isinstance(config, str), type(config)
self.name = name
self.config = config
self.io = io
self.cwd = cwd
self.line_prefixing = line_prefixing
def run(self) -> int:
import subprocess as sp
import sys
from codecs import getreader
from cleo.io.io import OutputType # type: ignore[import]
from ptyprocess import PtyProcessUnicode # type: ignore[import]
color = (
self._colors[0]
if TestRunner._prev_color is None
else self._colors[(self._colors.index(TestRunner._prev_color) + 1) % len(self._colors)]
)
TestRunner._prev_color = color
command = ["bash", "-c", self.config]
prefix = f"{self.name}| "
logger.info("Running command <subj>%s</subj> in <val>%s</val>", command, self.cwd)
try:
cols, rows = os.get_terminal_size()
except OSError:
sproc = sp.Popen(command, cwd=self.cwd, stdout=sp.PIPE, stderr=sp.STDOUT)
assert sproc.stdout
stdout = getreader(sys.getdefaultencoding())(sproc.stdout)
for line in iter(stdout.readline, ""):
line = line.rstrip()
if self.line_prefixing:
self.io.write(f"<fg={color}>{prefix}</fg>")
self.io.write(line + "\n", type=OutputType.NORMAL)
sproc.wait()
assert sproc.returncode is not None
return sproc.returncode
else:
proc = PtyProcessUnicode.spawn(command, dimensions=(rows, cols - len(prefix)), cwd=self.cwd)
while not proc.eof():
try:
line = proc.readline().rstrip()
except EOFError:
break
if self.line_prefixing:
self.io.write(f"<fg={color}>{prefix}</fg>")
self.io.write(line + "\n", type=OutputType.NORMAL)
proc.wait()
assert proc.exitstatus is not None
return proc.exitstatus
class Test(t.NamedTuple):
project: Project
name: str
command: str
@property
def id(self) -> str:
return f"{self.project.id}:{self.name}"
class TestCommandPlugin(VenvAwareCommand, ApplicationPlugin):
"""
Execute commands configured in <code>[tool.slap.test]</code>.
<b>Example configuration:</b>
<fg=cyan>[tool.slap.test]</fg>
<fg=green>pytest</fg> = <fg=yellow>"pytest --cov=my_package tests/"</fg>
<fg=green>mypy</fg> = <fg=yellow>"mypy src"</fg>
<b>Example usage:</b>
<fg=yellow>$</fg> slap test
<fg=dark_gray>mypy | Success: no issues found in 12 source files
pytest | ===================================== test session starts ======================================
pytest | platform linux -- Python 3.10.2, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
...</fg>
"""
app: Application
tests: list[Test]
name = "test"
arguments = [
argument("test", "One or more tests to run (runs all if none are specified)", optional=True, multiple=True),
]
options = [
option(
"--no-line-prefix",
"s",
description="Do not prefix output from the test commands with the test name (default if a single argument "
"for <info>test</info> is specified).",
),
option(
"--list",
"-l",
description="List all available tests",
),
]
options[0]._default = NotSet.Value # Hack to set a default value for the flag
def load_configuration(self, app: Application) -> None:
self.app = app
self.tests = []
for project in app.repository.projects():
for test_name, command in project.raw_config().get("test", {}).items():
self.tests.append(Test(project, test_name, command))
def activate(self, app: Application, config: None) -> None:
app.cleo.add(self)
def _select_tests(self, name: str) -> set[Test]:
result = set()
for test in self.tests:
use_test = (
self.app.repository.is_monorepo
and (name == test.id or (name.startswith(":") and test.name == name[1:]) or (test.project.id == name))
or not self.app.repository.is_monorepo
and (name == test.name)
)
if use_test:
result.add(test)
if not result:
raise ValueError(f"{name!r} did not match any tests")
return result
def handle(self) -> int:
if self.option("list"):
if self.argument("test"):
self.line_error("error: incompatible arguments (<opt>test</opt> and <opt>-l,--list</opt>)", "error")
return 1
for test in self.tests:
print(test.id)
return 0
if not self.tests:
self.line_error("error: no tests configured", "error")
return 1
test_names: list[str] = self.argument("test")
if not test_names:
tests = set(self.tests)
else:
try:
tests = {t for a in test_names for t in self._select_tests(a)}
except ValueError as exc:
self.line_error(f"error: {exc}", "error")
return 1
if (no_line_prefix := self.option("no-line-prefix")) is NotSet.Value:
no_line_prefix = test_names is not None and len(tests) == 1
single_project = len(set(t.project for t in self.tests)) == 1
results = {}
for test in sorted(tests, key=lambda t: t.id):
results[test.name if single_project else test.id] = TestRunner(
test.name if single_project else test.id,
test.command,
self.io,
test.project.directory,
not no_line_prefix,
).run()
if len(tests) > 1:
self.line("\n<comment>test summary:</comment>")
for test_name, exit_code in results.items():
color = "green" if exit_code == 0 else "red"
self.line(f" <fg={color}>โข</fg> {test_name} (exit code: {exit_code})")
return 0 if set(results.values()) == {0} else 1
|
longxiaobaiWJ/zce-cli
|
test/mock/templates/filters/index.js
|
<reponame>longxiaobaiWJ/zce-cli<gh_stars>1-10
module.exports = {
prompts: {
sass: { type: 'confirm', message: 'Use sass preprocessor?', default: true }
},
filters: {
'*/*.scss': a => a.sass,
'*/*.css': a => !a.sass
}
}
|
pimbongaerts/mesophotic
|
config/initializers/application.rb
|
<filename>config/initializers/application.rb<gh_stars>1-10
# Autoload paths
Rails.application.config.autoload_paths += %W(#{Rails.application.config.root}/lib)
Rails.application.config.autoload_paths += Dir["#{Rails.application.config.root}/lib/**/"]
# Do not swallow errors in after_commit/after_rollback callbacks.
Rails.application.config.active_record.raise_in_transactional_callbacks
|
yunstanford/transmute-core
|
transmute_core/function/__init__.py
|
from ..attributes import TransmuteAttributes
from .signature import FunctionSignature
from .response import Response
from .transmute_function import TransmuteFunction
__all__ = ["FunctionSignature", "Response", "TransmuteAttributes", "TransmuteFunction"]
|
zivchang/web-simulator
|
lib/ripple/config.js
|
/*
* Copyright 2011 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var exception = require('ripple/exception'),
_environmentConfiguration = {
"Production": {
"apiURL": "http://api.tinyhippos.com"
},
"Demo": {
"apiURL": "http://apidemo.tinyhippos.com"
},
"Local": {
"apiURL": "http://127.0.0.1:4567"
}
},
_environment = "Production";
module.exports = {
getAPIURL: function () {
return _environmentConfiguration[_environment].apiURL;
},
setEnvironment: function (env) {
if (!_environmentConfiguration[env]) {
exception.raise(exception.types.Application, "No configuration found for selected environment: " + env);
}
_environment = env;
}
};
|
gkno/seqan
|
core/tests/align/test_alignment_dp_matrix_navigator.h
|
// ==========================================================================
// test_alignment_dp_matrix_navigator.h
// ==========================================================================
// Copyright (c) 2006-2013, <NAME>, FU Berlin
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of Knut Reinert or the FU Berlin nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
//
// ==========================================================================
// Author: <NAME> <<EMAIL>>
// ==========================================================================
#ifndef SANDBOX_RMAERKER_TESTS_ALIGN2_TEST_ALIGNMENT_DP_MATRIX_NAVIGATOR_H_
#define SANDBOX_RMAERKER_TESTS_ALIGN2_TEST_ALIGNMENT_DP_MATRIX_NAVIGATOR_H_
#include <seqan/basic.h>
#include <seqan/align.h>
template <typename TSpec>
void testAlignmentDPMatrixScoreNavigatorConstructorDefault(TSpec const &)
{
using namespace seqan;
typedef DPMatrix_<int, TSpec> TDPMatrix;
typedef typename Value<TDPMatrix>::Type TDPCell;
typedef typename Iterator<TDPMatrix, Standard>::Type TIterator;
DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigator;
// Test if default constructor sets NULL pointer
bool resultPointer = true;
if (dpScoreMatrixNavigator._ptrDataContainer)
resultPointer = false;
bool resultPrevColIter = true;
if (dpScoreMatrixNavigator._prevColIterator != TIterator())
resultPrevColIter = false;
bool resultActiveColIter = true;
if (dpScoreMatrixNavigator._activeColIterator != TIterator())
resultActiveColIter = false;
SEQAN_ASSERT_EQ(resultPointer, true);
SEQAN_ASSERT_EQ(resultPrevColIter, true);
SEQAN_ASSERT_EQ(resultActiveColIter, true);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, TDPCell());
}
template <typename TSpec>
void testAlignmentDPMatrixTraceNavigatorConstructorDefault(TSpec const &)
{
using namespace seqan;
typedef DPMatrix_<int, FullDPMatrix> TDPMatrix;
typedef typename Iterator<TDPMatrix, Standard>::Type TIterator;
DPMatrixNavigator_<TDPMatrix, DPTraceMatrix<TSpec>, NavigateColumnWise> dpTraceMatrixNavigator;
// Test if default constructor sets NULL pointer
bool resultPointer = true;
if (dpTraceMatrixNavigator._ptrDataContainer)
resultPointer = false;
bool resultActiveColIter = true;
if (dpTraceMatrixNavigator._activeColIterator != TIterator())
resultActiveColIter = false;
SEQAN_ASSERT_EQ(resultPointer, true);
SEQAN_ASSERT_EQ(resultActiveColIter, true);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 0);
}
void testAlignmentDPMatrixNavigatorScoreMarixSparseContructor()
{
using namespace seqan;
typedef DPMatrix_<int, SparseDPMatrix> TDPMatrix;
typedef Value<TDPMatrix>::Type TDPCell;
typedef Iterator<TDPMatrix, Standard>::Type TIterator;
DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigator;
// Test if default constructor sets NULL pointer
bool resultPointer = true;
if (dpScoreMatrixNavigator._ptrDataContainer)
resultPointer = false;
bool resultActiveColIter = true;
if (dpScoreMatrixNavigator._activeColIterator != TIterator())
resultActiveColIter = false;
bool resultPrevColIter = true;
if (dpScoreMatrixNavigator._prevColIterator != TIterator())
resultPrevColIter = false;
SEQAN_ASSERT_EQ(resultPointer, true);
SEQAN_ASSERT_EQ(resultActiveColIter, true);
SEQAN_ASSERT_EQ(resultPrevColIter, true);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, TDPCell());
}
void testAlignmentDPMatrixNavigatorScoreMarixInitUnbanded()
{
using namespace seqan;
typedef DPMatrix_<int, FullDPMatrix> TDPMatrix;
typedef Value<TDPMatrix>::Type TDPCell;
DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 10);
resize(dpMatrix, 0);
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), -10);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, TDPCell());
}
void testAlignmentDPMatrixNavigatorScoreMarixSparseInitUnbanded()
{
using namespace seqan;
typedef DPMatrix_<int, SparseDPMatrix> TDPMatrix;
typedef Value<TDPMatrix>::Type TDPCell;
typedef DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> TDPMatrixNavigator;
TDPMatrixNavigator dpScoreMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 10);
resize(dpMatrix, 0);
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(value(dpScoreMatrixNavigator._activeColIterator), 0);
SEQAN_ASSERT_EQ(value(dpScoreMatrixNavigator._prevColIterator), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -9);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, TDPCell());
}
void testAlignmentDPMatrixNavigatorScoreMarixInitBanded()
{
using namespace seqan;
typedef DPMatrix_<int, FullDPMatrix> TDPMatrix;
typedef Value<TDPMatrix>::Type TDPCell;
typedef DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> TDPMatrixNavigator;
TDPMatrixNavigator dpScoreMatrixNavigator;
{ // Case1: Band intersects with poit of origin.
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 8);
resize(dpMatrix, 0);
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOn>(-4, 3));
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), -5);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, TDPCell());
}
{
TDPMatrix dpMatrix2;
setLength(dpMatrix2, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix2, DPMatrixDimension_::VERTICAL, 8);
resize(dpMatrix2);
value(host(dpMatrix2), 0) = 10;
_init(dpScoreMatrixNavigator, dpMatrix2, DPBand_<BandOn>(0, 7));
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix2, Standard()), 7);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix2, Standard()), -1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 8);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, TDPCell());
}
{
TDPMatrix dpMatrix3;
setLength(dpMatrix3, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix3, DPMatrixDimension_::VERTICAL, 8);
resize(dpMatrix3);
_init(dpScoreMatrixNavigator, dpMatrix3, DPBand_<BandOn>(-7, 0));
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix3, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix3, Standard()), -8);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, TDPCell());
}
}
void testAlignmentDPMatrixNavigatorScoreMarixSparseInitBanded()
{
using namespace seqan;
typedef DPMatrix_<int, SparseDPMatrix> TDPMatrix;
typedef Value<TDPMatrix>::Type TDPCell;
typedef DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> TDPMatrixNavigator;
TDPMatrixNavigator dpScoreMatrixNavigator;
{
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 8);
resize(dpMatrix, 0);
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOn>(-4, 3));
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, TDPCell());
}
{
TDPMatrix dpMatrix2;
setLength(dpMatrix2, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix2, DPMatrixDimension_::VERTICAL, 8);
resize(dpMatrix2);
_init(dpScoreMatrixNavigator, dpMatrix2, DPBand_<BandOn>(0, 7));
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix2, Standard()), 7);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix2, Standard()), 7); // Behind the last cell.
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, TDPCell());
}
{
TDPMatrix dpMatrix3;
setLength(dpMatrix3, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix3, DPMatrixDimension_::VERTICAL, 8);
resize(dpMatrix3);
_init(dpScoreMatrixNavigator, dpMatrix3, DPBand_<BandOn>(-7, 0));
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix3, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix3, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -7);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, TDPCell());
}
}
void testAlignmentDPMatrixNavigatorScoreMarixGoNextCell()
{
using namespace seqan;
typedef DPMatrix_<int, FullDPMatrix> TDPMatrix;
typedef Value<TDPMatrix>::Type TDPCell;
DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 3);
resize(dpMatrix, 0);
host(dpMatrix)[0] = 0;
host(dpMatrix)[1] = 1;
host(dpMatrix)[2] = 2;
host(dpMatrix)[3] = 3;
host(dpMatrix)[4] = 4;
host(dpMatrix)[5] = 5;
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnTop>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), -3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnTop>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnTop>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), -1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnMiddle>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), -3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnMiddle>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnMiddle>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), -1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnBottom>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), -3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnBottom>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnBottom>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), -1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, FullColumn>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), -3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, FullColumn>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, FullColumn>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), -1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpScoreMatrixNavigator._activeColIterator += 2;
dpScoreMatrixNavigator._prevColIterator += 2;
++dpScoreMatrixNavigator._laneLeap; // For the test we simulate as if we were in a band.
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnTop>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnTop>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnTop>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpScoreMatrixNavigator._activeColIterator += 2;
dpScoreMatrixNavigator._prevColIterator += 2;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnMiddle>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnMiddle>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnMiddle>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpScoreMatrixNavigator._activeColIterator += 2;
dpScoreMatrixNavigator._prevColIterator += 2;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnBottom>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnBottom>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnBottom>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 2);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpScoreMatrixNavigator._activeColIterator += 2;
dpScoreMatrixNavigator._prevColIterator += 2;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, FullColumn>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, FullColumn>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, FullColumn>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpScoreMatrixNavigator._activeColIterator += 2;
dpScoreMatrixNavigator._prevColIterator += 2;
++dpScoreMatrixNavigator._laneLeap;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnTop>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnTop>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnTop>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpScoreMatrixNavigator._activeColIterator += 2;
dpScoreMatrixNavigator._prevColIterator += 2;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnMiddle>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnMiddle>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnMiddle>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpScoreMatrixNavigator._activeColIterator += 2;
dpScoreMatrixNavigator._prevColIterator += 2;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnBottom>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnBottom>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnBottom>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 2);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpScoreMatrixNavigator._activeColIterator += 2;
dpScoreMatrixNavigator._prevColIterator += 2;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, FullColumn>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, FullColumn>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, FullColumn>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 4);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, 1);
}
}
void testAlignmentDPMatrixNavigatorScoreMarixSparseGoNext()
{
using namespace seqan;
typedef DPMatrix_<int, SparseDPMatrix> TDPMatrix;
typedef Value<TDPMatrix>::Type TDPCell;
DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 3);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 3);
resize(dpMatrix, 3);
host(dpMatrix)[1] = 1;
host(dpMatrix)[2] = 2;
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpScoreMatrixNavigator._activeColIterator, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, TDPCell());
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnTop>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, TDPCell());
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnTop>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0); // Was never set to 0.
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnTop>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpScoreMatrixNavigator._activeColIterator, 0);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnMiddle>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnMiddle>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnMiddle>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpScoreMatrixNavigator._activeColIterator, 0);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnBottom>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnBottom>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnBottom>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpScoreMatrixNavigator._activeColIterator, 0);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, FullColumn>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, FullColumn>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, FullColumn>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpScoreMatrixNavigator._activeColIterator, 0);
// Need to update iterator just for the test.
dpScoreMatrixNavigator._activeColIterator += 3;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnTop>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnTop>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnTop>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpScoreMatrixNavigator._activeColIterator, 0);
// Need to update Iterator just for the test.
dpScoreMatrixNavigator._activeColIterator += 2;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnMiddle>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnMiddle>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnMiddle>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpScoreMatrixNavigator._activeColIterator, 0);
// Need to update Iterator just for the test.
dpScoreMatrixNavigator._activeColIterator += 2;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnBottom>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnBottom>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0);
// Need to set iterator to correct position just for the test.
--dpScoreMatrixNavigator._prevColIterator;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnBottom>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpScoreMatrixNavigator._activeColIterator, 0);
dpScoreMatrixNavigator._activeColIterator += 2;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, FullColumn>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, FullColumn>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, FullColumn>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpScoreMatrixNavigator._activeColIterator, 0);
dpScoreMatrixNavigator._activeColIterator += 3;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnTop>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnTop>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnTop>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -3);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpScoreMatrixNavigator._activeColIterator, 0);
dpScoreMatrixNavigator._activeColIterator += 2;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnMiddle>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnMiddle>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnMiddle>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpScoreMatrixNavigator._activeColIterator, 0);
dpScoreMatrixNavigator._activeColIterator += 2;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnBottom>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnBottom>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0);
--dpScoreMatrixNavigator._prevColIterator;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnBottom>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
}
{
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpScoreMatrixNavigator._activeColIterator, 0);
dpScoreMatrixNavigator._activeColIterator += 2;
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, FullColumn>(), FirstCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, FullColumn>(), InnerCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 0);
_goNextCell(dpScoreMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, FullColumn>(), LastCell());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._laneLeap, -2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, 1);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, 2);
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, 1);
}
}
template <typename TDPMatrixSpec>
void testAlignmentDPScoreMatrixNavigatorAssignValue(TDPMatrixSpec const)
{
using namespace seqan;
typedef DPMatrix_<int, TDPMatrixSpec> TDPMatrix;
DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 10);
resize(dpMatrix, 3);
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpScoreMatrixNavigator, 20);
SEQAN_ASSERT_EQ(value(dpScoreMatrixNavigator._activeColIterator), 20);
}
template <typename TDPMatrixSpec>
void testAlignmentDPScoreMatrixNavigatorValue(TDPMatrixSpec const)
{
using namespace seqan;
typedef DPMatrix_<int, TDPMatrixSpec> TDPMatrix;
DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 10);
resize(dpMatrix, 3);
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpScoreMatrixNavigator, 20);
SEQAN_ASSERT_EQ(value(dpScoreMatrixNavigator), 20);
const DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigatorConst(dpScoreMatrixNavigator);
SEQAN_ASSERT_EQ(value(dpScoreMatrixNavigatorConst), 20);
}
template <typename TDPMatrixSpec>
void testAlignmentDPScoreMatrixNavigatorPreviousCellDiagonal(TDPMatrixSpec const)
{
using namespace seqan;
typedef DPMatrix_<int, TDPMatrixSpec> TDPMatrix;
typedef typename Value<TDPMatrix>::Type TDPCell;
DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 10);
resize(dpMatrix, 3);
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellDiagonal, TDPCell());
dpScoreMatrixNavigator._prevCellDiagonal = 20;
SEQAN_ASSERT_EQ(previousCellDiagonal(dpScoreMatrixNavigator), 20);
const DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigatorConst(dpScoreMatrixNavigator);
SEQAN_ASSERT_EQ(previousCellDiagonal(dpScoreMatrixNavigatorConst), 20);
}
template <typename TDPMatrixSpec>
void testAlignmentDPScoreMatrixNavigatorPreviousCellHorizontal(TDPMatrixSpec const)
{
using namespace seqan;
typedef DPMatrix_<int, TDPMatrixSpec> TDPMatrix;
typedef typename Value<TDPMatrix>::Type TDPCell;
DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 10);
resize(dpMatrix, 3);
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellHorizontal, TDPCell());
dpScoreMatrixNavigator._prevCellHorizontal = 20;
SEQAN_ASSERT_EQ(previousCellHorizontal(dpScoreMatrixNavigator), 20);
const DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigatorConst(dpScoreMatrixNavigator);
SEQAN_ASSERT_EQ(previousCellHorizontal(dpScoreMatrixNavigatorConst), 20);
}
template <typename TDPMatrixSpec>
void testAlignmentDPScoreMatrixNavigatorPreviousCellVertical(TDPMatrixSpec const)
{
using namespace seqan;
typedef DPMatrix_<int, TDPMatrixSpec> TDPMatrix;
typedef typename Value<TDPMatrix>::Type TDPCell;
DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 10);
resize(dpMatrix, 3);
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
SEQAN_ASSERT_EQ(dpScoreMatrixNavigator._prevCellVertical, TDPCell());
dpScoreMatrixNavigator._prevCellVertical = 20;
SEQAN_ASSERT_EQ(previousCellVertical(dpScoreMatrixNavigator), 20);
const DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigatorConst(dpScoreMatrixNavigator);
SEQAN_ASSERT_EQ(previousCellVertical(dpScoreMatrixNavigatorConst), 20);
}
template <typename TDPMatrixSpec>
void testAlignmentDPScoreMatrixNavigatorCoordinate(TDPMatrixSpec const)
{
using namespace seqan;
typedef DPMatrix_<int, TDPMatrixSpec> TDPMatrix;
DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 10);
resize(dpMatrix, 3);
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpScoreMatrixNavigator._activeColIterator += 7;
dpScoreMatrixNavigator._prevColIterator += 7;
SEQAN_ASSERT_EQ(coordinate(dpScoreMatrixNavigator, +DPMatrixDimension_::HORIZONTAL), 0u);
SEQAN_ASSERT_EQ(coordinate(dpScoreMatrixNavigator, +DPMatrixDimension_::VERTICAL), 7u);
}
template <typename TDPMatrixSpec>
void testAlignmentDPScoreMatrixNavigatorContainer(TDPMatrixSpec const)
{
using namespace seqan;
typedef DPMatrix_<int, TDPMatrixSpec> TDPMatrix;
DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 10);
resize(dpMatrix, 3);
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
SEQAN_ASSERT_EQ(&container(dpScoreMatrixNavigator), &dpMatrix);
const DPMatrixNavigator_<TDPMatrix, DPScoreMatrix, NavigateColumnWise> dpScoreMatrixNavigatorConst(dpScoreMatrixNavigator);
SEQAN_ASSERT_EQ(&container(dpScoreMatrixNavigatorConst), &dpMatrix);
}
// ----------------------------------------------------------------------------
// Test constructor [DPScoreMatrix, FullDPMatrix]
// ----------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_full_constructor)
{
testAlignmentDPMatrixScoreNavigatorConstructorDefault(seqan::FullDPMatrix());
}
// ----------------------------------------------------------------------------
// Test functions [DPScoreMatrix, FullDPMatrix]
// ----------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_full_init_unbanded)
{
testAlignmentDPMatrixNavigatorScoreMarixInitUnbanded();
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_full_init_banded)
{
testAlignmentDPMatrixNavigatorScoreMarixInitBanded();
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_full_go_next_cell)
{
testAlignmentDPMatrixNavigatorScoreMarixGoNextCell();
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_full_assign_value)
{
testAlignmentDPScoreMatrixNavigatorAssignValue(seqan::FullDPMatrix());
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_full_value)
{
testAlignmentDPScoreMatrixNavigatorValue(seqan::FullDPMatrix());
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_full_previous_cell_diagonal)
{
testAlignmentDPScoreMatrixNavigatorPreviousCellDiagonal(seqan::FullDPMatrix());
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_full_previous_cell_horizontal)
{
testAlignmentDPScoreMatrixNavigatorPreviousCellHorizontal(seqan::FullDPMatrix());
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_full_previous_cell_vertical)
{
testAlignmentDPScoreMatrixNavigatorPreviousCellVertical(seqan::FullDPMatrix());
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_full_coordinate)
{
testAlignmentDPScoreMatrixNavigatorCoordinate(seqan::FullDPMatrix());
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_full_container)
{
testAlignmentDPScoreMatrixNavigatorContainer(seqan::FullDPMatrix());
}
// ----------------------------------------------------------------------------
// Test constructor [DPScoreMatrix, SparseDPMatrix]
// ----------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_sparse_constructor)
{
testAlignmentDPMatrixScoreNavigatorConstructorDefault(seqan::SparseDPMatrix());
}
// ----------------------------------------------------------------------------
// Test functions [DPScoreMatrix, SparseDPMatrix]
// ----------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_sparse_init_unbanded)
{
testAlignmentDPMatrixNavigatorScoreMarixSparseInitUnbanded();
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_sparse_init_banded)
{
testAlignmentDPMatrixNavigatorScoreMarixSparseInitBanded();
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_sparse_go_next)
{
testAlignmentDPMatrixNavigatorScoreMarixSparseGoNext();
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_sparse_assign_value)
{
testAlignmentDPScoreMatrixNavigatorAssignValue(seqan::SparseDPMatrix());
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_sparse_value)
{
testAlignmentDPScoreMatrixNavigatorValue(seqan::SparseDPMatrix());
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_sparse_previous_cell_diagonal)
{
testAlignmentDPScoreMatrixNavigatorPreviousCellDiagonal(seqan::SparseDPMatrix());
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_sparse_previous_cell_horizontal)
{
testAlignmentDPScoreMatrixNavigatorPreviousCellHorizontal(seqan::SparseDPMatrix());
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_sparse_previous_cell_vertical)
{
testAlignmentDPScoreMatrixNavigatorPreviousCellVertical(seqan::SparseDPMatrix());
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_sparse_coordinate)
{
testAlignmentDPScoreMatrixNavigatorCoordinate(seqan::SparseDPMatrix());
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_score_matrix_sparse_container)
{
testAlignmentDPScoreMatrixNavigatorContainer(seqan::SparseDPMatrix());
}
// ----------------------------------------------------------------------------
// Test constructor [DPTraceMatrix, FullDPMatrix]
// ----------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_trace_matrix_constructor)
{
testAlignmentDPMatrixTraceNavigatorConstructorDefault(seqan::TracebackOn<seqan::GapsLeft>());
testAlignmentDPMatrixTraceNavigatorConstructorDefault(seqan::TracebackOff());
}
// ----------------------------------------------------------------------------
// Test functions [DPTraceMatrix, FullDPMatrix]
// ----------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_trace_matrix_enabled_init_unbanded)
{
using namespace seqan;
typedef DPMatrix_<int, FullDPMatrix> TDPMatrix;
DPMatrixNavigator_<TDPMatrix, DPTraceMatrix<TracebackOn<GapsLeft> >, NavigateColumnWise> dpTraceMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 10);
resize(dpMatrix);
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_trace_matrix_disabled_init_unbanded)
{
using namespace seqan;
typedef DPMatrix_<int, FullDPMatrix> TDPMatrix;
DPMatrixNavigator_<TDPMatrix, DPTraceMatrix<TracebackOff>, NavigateColumnWise> dpTraceMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 10);
resize(dpMatrix);
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
SEQAN_ASSERT_NEQ(dpTraceMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 0);
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_trace_matrix_enabled_init_banded)
{
using namespace seqan;
typedef DPMatrix_<int, FullDPMatrix> TDPMatrix;
DPMatrixNavigator_<TDPMatrix, DPTraceMatrix<TracebackOn<GapsLeft> >, NavigateColumnWise> dpTraceMatrixNavigator;
{ // Case1: Band intersects with poit of origin.
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 8);
resize(dpMatrix);
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOn>(-4, 3));
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 4);
}
{
TDPMatrix dpMatrix2;
setLength(dpMatrix2, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix2, DPMatrixDimension_::VERTICAL, 8);
resize(dpMatrix2);
value(host(dpMatrix2), 0) = 10;
_init(dpTraceMatrixNavigator, dpMatrix2, DPBand_<BandOn>(0, 7));
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._ptrDataContainer, &dpMatrix2);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix2, Standard()), 7);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 8);
}
{
TDPMatrix dpMatrix3;
setLength(dpMatrix3, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix3, DPMatrixDimension_::VERTICAL, 8);
resize(dpMatrix3);
_init(dpTraceMatrixNavigator, dpMatrix3, DPBand_<BandOn>(-7, 0));
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._ptrDataContainer, &dpMatrix3);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix3, Standard()), 0);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
}
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_trace_matrix_disabled_init_banded)
{
using namespace seqan;
typedef DPMatrix_<int, FullDPMatrix> TDPMatrix;
DPMatrixNavigator_<TDPMatrix, DPTraceMatrix<TracebackOff>, NavigateColumnWise> dpTraceMatrixNavigator;
{ // Case1: Band intersects with poit of origin.
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 8);
resize(dpMatrix);
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOn>(-4, 3));
SEQAN_ASSERT_NEQ(dpTraceMatrixNavigator._ptrDataContainer, &dpMatrix);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 0);
}
{
TDPMatrix dpMatrix2;
setLength(dpMatrix2, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix2, DPMatrixDimension_::VERTICAL, 8);
resize(dpMatrix2);
value(host(dpMatrix2), 0) = 10;
_init(dpTraceMatrixNavigator, dpMatrix2, DPBand_<BandOn>(0, 7));
SEQAN_ASSERT_NEQ(dpTraceMatrixNavigator._ptrDataContainer, &dpMatrix2);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 0);
}
{
TDPMatrix dpMatrix3;
setLength(dpMatrix3, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix3, DPMatrixDimension_::VERTICAL, 8);
resize(dpMatrix3);
_init(dpTraceMatrixNavigator, dpMatrix3, DPBand_<BandOn>(-7, 0));
SEQAN_ASSERT_NEQ(dpTraceMatrixNavigator._ptrDataContainer, &dpMatrix3);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 0);
}
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_trace_matrix_enabled_go_next)
{
using namespace seqan;
typedef DPMatrix_<int, FullDPMatrix> TDPMatrix;
DPMatrixNavigator_<TDPMatrix, DPTraceMatrix<TracebackOn<GapsLeft> >, NavigateColumnWise> dpTraceMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 3);
resize(dpMatrix, 0);
host(dpMatrix)[0] = 0;
host(dpMatrix)[1] = 1;
host(dpMatrix)[2] = 2;
host(dpMatrix)[3] = 3;
host(dpMatrix)[4] = 4;
host(dpMatrix)[5] = 5;
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnTop>(), FirstCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnTop>(), InnerCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnTop>(), LastCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnMiddle>(), FirstCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnMiddle>(), InnerCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnMiddle>(), LastCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnBottom>(), FirstCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnBottom>(), InnerCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnBottom>(), LastCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, FullColumn>(), FirstCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 0);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, FullColumn>(), InnerCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 1);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, FullColumn>(), LastCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 2);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpTraceMatrixNavigator._activeColIterator += 2;
++dpTraceMatrixNavigator._laneLeap; // For the test we simulate as if we were in a band.
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnTop>(), FirstCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnTop>(), InnerCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnTop>(), LastCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpTraceMatrixNavigator._activeColIterator += 2;
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnMiddle>(), FirstCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnMiddle>(), InnerCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnMiddle>(), LastCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpTraceMatrixNavigator._activeColIterator += 2;
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnBottom>(), FirstCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnBottom>(), InnerCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnBottom>(), LastCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 2);
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpTraceMatrixNavigator._activeColIterator += 2;
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, FullColumn>(), FirstCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, FullColumn>(), InnerCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, FullColumn>(), LastCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpTraceMatrixNavigator._activeColIterator += 2;
++dpTraceMatrixNavigator._laneLeap;
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnTop>(), FirstCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnTop>(), InnerCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnTop>(), LastCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpTraceMatrixNavigator._activeColIterator += 2;
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnMiddle>(), FirstCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnMiddle>(), InnerCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnMiddle>(), LastCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpTraceMatrixNavigator._activeColIterator += 2;
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnBottom>(), FirstCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnBottom>(), InnerCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnBottom>(), LastCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 2);
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpTraceMatrixNavigator._activeColIterator += 2;
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, FullColumn>(), FirstCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 3);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, FullColumn>(), InnerCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 4);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
_goNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, FullColumn>(), LastCell());
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._activeColIterator - begin(dpMatrix, Standard()), 5);
SEQAN_ASSERT_EQ(dpTraceMatrixNavigator._laneLeap, 1);
}
}
template <typename TNavigator, typename TMetaDescriptor, typename TCell>
void _testGoNextCell(TNavigator & navi, TMetaDescriptor const &, TCell const &)
{
using namespace seqan;
_goNextCell(navi, TMetaDescriptor(), TCell());
SEQAN_ASSERT_EQ(navi._laneLeap, 0);
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_trace_matrix_disabled_go_next)
{
using namespace seqan;
typedef DPMatrix_<int, FullDPMatrix> TDPMatrix;
DPMatrixNavigator_<TDPMatrix, DPTraceMatrix<TracebackOff>, NavigateColumnWise> dpTraceMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 3);
resize(dpMatrix, 0);
host(dpMatrix)[0] = 0;
host(dpMatrix)[1] = 1;
host(dpMatrix)[2] = 2;
host(dpMatrix)[3] = 3;
host(dpMatrix)[4] = 4;
host(dpMatrix)[5] = 5;
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnTop>(), FirstCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnTop>(), InnerCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnTop>(), LastCell());
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnMiddle>(), FirstCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnMiddle>(), InnerCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnMiddle>(), LastCell());
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnBottom>(), FirstCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnBottom>(), InnerCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, PartialColumnBottom>(), LastCell());
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, FullColumn>(), FirstCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, FullColumn>(), InnerCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInitialColumn, FullColumn>(), LastCell());
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpTraceMatrixNavigator._activeColIterator += 2;
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnTop>(), FirstCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnTop>(), InnerCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnTop>(), LastCell());
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnMiddle>(), FirstCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnMiddle>(), InnerCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnMiddle>(), LastCell());
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnBottom>(), FirstCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnBottom>(), InnerCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, PartialColumnBottom>(), LastCell());
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, FullColumn>(), FirstCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, FullColumn>(), InnerCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPInnerColumn, FullColumn>(), LastCell());
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnTop>(), FirstCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnTop>(), InnerCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnTop>(), LastCell());
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnMiddle>(), FirstCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnMiddle>(), InnerCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnMiddle>(), LastCell());
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnBottom>(), FirstCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnBottom>(), InnerCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, PartialColumnBottom>(), LastCell());
}
{
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, FullColumn>(), FirstCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, FullColumn>(), InnerCell());
_testGoNextCell(dpTraceMatrixNavigator, MetaColumnDescriptor<DPFinalColumn, FullColumn>(), LastCell());
}
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_trace_matrix_enabled_assign_value)
{
using namespace seqan;
typedef DPMatrix_<int, FullDPMatrix> TDPMatrix;
DPMatrixNavigator_<TDPMatrix, DPTraceMatrix<TracebackOn<GapsLeft> >, NavigateColumnWise> dpScoreMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 10);
resize(dpMatrix, 3);
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpScoreMatrixNavigator, 20);
SEQAN_ASSERT_EQ(value(dpScoreMatrixNavigator._activeColIterator), 20);
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_trace_matrix_enabled_value)
{
using namespace seqan;
typedef DPMatrix_<int, FullDPMatrix> TDPMatrix;
DPMatrixNavigator_<TDPMatrix, DPTraceMatrix<TracebackOn<GapsLeft> >, NavigateColumnWise> dpTraceMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 10);
resize(dpMatrix, 3);
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
assignValue(dpTraceMatrixNavigator, 20);
SEQAN_ASSERT_EQ(value(dpTraceMatrixNavigator), 20);
const DPMatrixNavigator_<TDPMatrix, DPTraceMatrix<TracebackOn<GapsLeft> >, NavigateColumnWise> dpTraceMatrixNavigatorConst(dpTraceMatrixNavigator);
SEQAN_ASSERT_EQ(value(dpTraceMatrixNavigatorConst), 20);
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_trace_matrix_enabled_coordinate)
{
using namespace seqan;
typedef DPMatrix_<int, FullDPMatrix> TDPMatrix;
DPMatrixNavigator_<TDPMatrix, DPTraceMatrix<TracebackOn<GapsLeft> >, NavigateColumnWise> dpScoreMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 10);
resize(dpMatrix, 3);
_init(dpScoreMatrixNavigator, dpMatrix, DPBand_<BandOff>());
dpScoreMatrixNavigator._activeColIterator += 7;
SEQAN_ASSERT_EQ(coordinate(dpScoreMatrixNavigator, +DPMatrixDimension_::HORIZONTAL), 0u);
SEQAN_ASSERT_EQ(coordinate(dpScoreMatrixNavigator, +DPMatrixDimension_::VERTICAL), 7u);
}
SEQAN_DEFINE_TEST(test_alignment_dp_matrix_navigator_trace_matrix_enabled_container)
{
using namespace seqan;
typedef DPMatrix_<int, FullDPMatrix> TDPMatrix;
DPMatrixNavigator_<TDPMatrix, DPTraceMatrix<TracebackOn<GapsLeft> >, NavigateColumnWise> dpTraceMatrixNavigator;
TDPMatrix dpMatrix;
setLength(dpMatrix, DPMatrixDimension_::HORIZONTAL, 10);
setLength(dpMatrix, DPMatrixDimension_::VERTICAL, 10);
resize(dpMatrix, 3);
_init(dpTraceMatrixNavigator, dpMatrix, DPBand_<BandOff>());
SEQAN_ASSERT_EQ(&container(dpTraceMatrixNavigator), &dpMatrix);
const DPMatrixNavigator_<TDPMatrix, DPTraceMatrix<TracebackOn<GapsLeft> >, NavigateColumnWise> dpTraceMatrixNavigatorConst(dpTraceMatrixNavigator);
SEQAN_ASSERT_EQ(&container(dpTraceMatrixNavigatorConst), &dpMatrix);
}
#endif // #ifndef SANDBOX_RMAERKER_TESTS_ALIGN2_TEST_ALIGNMENT_DP_MATRIX_NAVIGATOR_H_
|
ScalablyTyped/SlinkyTyped
|
a/activex-libreoffice/src/main/scala/typingsSlinky/activexLibreoffice/com_/sun/star/sdbc/SQLException.scala
|
package typingsSlinky.activexLibreoffice.com_.sun.star.sdbc
import typingsSlinky.activexLibreoffice.com_.sun.star.uno.Exception
import typingsSlinky.activexLibreoffice.com_.sun.star.uno.XInterface
import org.scalablytyped.runtime.StObject
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess}
/**
* is an exception that provides information on a database access error.
*
* Each {@link com.sun.star.sdbc.SQLException} provides several kinds of information:
*
* a string describing the error. This is used as the {@link com.sun.star.uno.Exception} message.
*/
@js.native
trait SQLException extends Exception {
/**
* returns an integer error code that is specific to each vendor. Normally this will be the actual error code returned by the underlying database. A
* chain to the next Exception. This can be used to provide additional error information.
*/
var ErrorCode: Double = js.native
/** returns a chain to the next Exception. This can be used to provide additional error information. */
var NextException: js.Any = js.native
/** returns a string, which uses the XOPEN SQLState conventions. The values of the SQLState string are described in the XOPEN SQL spec. */
var SQLState: String = js.native
}
object SQLException {
@scala.inline
def apply(Context: XInterface, ErrorCode: Double, Message: String, NextException: js.Any, SQLState: String): SQLException = {
val __obj = js.Dynamic.literal(Context = Context.asInstanceOf[js.Any], ErrorCode = ErrorCode.asInstanceOf[js.Any], Message = Message.asInstanceOf[js.Any], NextException = NextException.asInstanceOf[js.Any], SQLState = SQLState.asInstanceOf[js.Any])
__obj.asInstanceOf[SQLException]
}
@scala.inline
implicit class SQLExceptionMutableBuilder[Self <: SQLException] (val x: Self) extends AnyVal {
@scala.inline
def setErrorCode(value: Double): Self = StObject.set(x, "ErrorCode", value.asInstanceOf[js.Any])
@scala.inline
def setNextException(value: js.Any): Self = StObject.set(x, "NextException", value.asInstanceOf[js.Any])
@scala.inline
def setSQLState(value: String): Self = StObject.set(x, "SQLState", value.asInstanceOf[js.Any])
}
}
|
dehuszar/resume-builder-fe
|
app/adapters/application.js
|
<filename>app/adapters/application.js
export default DS.SailsRESTAdapter.extend({
// You will want to change this api-host url
// It is presently set up to accommodate a local install
host: 'http://0.0.0.0:1337',
log: true
});
|
florianl/u-root
|
pkg/pci/class.go
|
<reponame>florianl/u-root<filename>pkg/pci/class.go
// Copyright 2021 the u-root Authors. All rights reserved
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package pci
// Class definitions for PCI.
const (
ClassNotDefined = 0x0000
ClassNotDefinedVGA = 0x0001
ClassStorage = 0x01
ClassStorageSCSI = 0x0100
ClassStorageIDE = 0x0101
ClassStorageFLOPPY = 0x0102
ClassStorageIPI = 0x0103
ClassStorageRAID = 0x0104
ClassStorageATA = 0x0105
ClassStorageSATA = 0x0106
ClassStorageSAS = 0x0107
ClassStorageOther = 0x0180
ClassNetwork = 0x02
ClassNetworkEthernet = 0x0200
ClassNetworkOther = 0x0280
ClassDisplay = 0x03
ClassDisplayVGA = 0x0300
ClassDisplayXGA = 0x0301
ClassDisplay3D = 0x0302
ClassDisplayOther = 0x0380
ClassMultimedia = 0x04
ClassMultimediaVideo = 0x0400
ClassMultimediaAudio = 0x0401
ClassMultimediaPhone = 0x0402
ClassMultimediaAudioDev = 0x0403
ClassMultimediaOther = 0x0480
ClassMemory = 0x05
ClassMemoryRAM = 0x0500
ClassMemoryFLASH = 0x0501
ClassMemoryOther = 0x0580
ClassBridge = 0x06
ClassBridgeHost = 0x0600
ClassBridgeISA = 0x0601
ClassBridgeEISA = 0x0602
ClassBridgeMC = 0x0603
ClassBridgePCI = 0x0604
ClassBridgePCMCIA = 0x0605
ClassBridgeNUBUS = 0x0606
ClassBridgeCARDBUS = 0x0607
ClassBridgeRACEWAY = 0x0608
ClassBridgePCISemi = 0x0609
ClassBridgeIBToPCI = 0x060a
ClassBridgeOther = 0x0680
ClassCommunication = 0x07
ClassCommunicationSerial = 0x0700
ClassCommunicationParallel = 0x0701
ClassCommunicationMSerial = 0x0702
ClassCommunicationModem = 0x0703
ClassCommunicationOther = 0x0780
ClassSystem = 0x08
ClassSystemPIC = 0x0800
ClassSystemDMA = 0x0801
ClassSystemTimer = 0x0802
ClassSystemRTC = 0x0803
ClassSystemPCIHotplug = 0x0804
ClassSystemOther = 0x0880
ClassInput = 0x09
ClassInputKeyboard = 0x0900
ClassInputPen = 0x0901
ClassInputMouse = 0x0902
ClassInputScanner = 0x0903
ClassInputGameport = 0x0904
ClassInputOther = 0x0980
ClassDocking = 0x0a
ClassDockingGeneric = 0x0a00
ClassDockingOther = 0x0a80
ClassProcessor = 0x0b
ClassProcessor386 = 0x0b00
ClassProcessor486 = 0x0b01
ClassProcessorPentium = 0x0b02
ClassProcessorALPHA = 0x0b10
ClassProcessorPOWERPC = 0x0b20
ClassProcessorMIPS = 0x0b30
ClassProcessorCO = 0x0b40
ClassSerial = 0x0c
ClassSerialFirewire = 0x0c00
ClassSerialAccess = 0x0c01
ClassSerialSSA = 0x0c02
ClassSerialUSB = 0x0c03
ClassSerialFIBER = 0x0c04
ClassSerialSMBUS = 0x0c05
ClassSerialINFINIBAND = 0x0c06
ClassWireless = 0x0d
ClassWirelessIRDA = 0x0d00
ClassWirelessCONSUMERIR = 0x0d01
ClassWirelessRF = 0x0d10
ClassWirelessOther = 0x0d80
ClassSatellite = 0x0f
ClassSatelliteTV = 0x0f00
ClassSatelliteAudio = 0x0f01
ClassSatelliteVoice = 0x0f03
ClassSatelliteData = 0x0f04
ClassCrypt = 0x10
ClassCryptNetwork = 0x1000
ClassCryptEntertainment = 0x1010
ClassCryptOther = 0x1080
ClassSignal = 0x11
ClassSignalDPIO = 0x1100
ClassSignalPERFCTR = 0x1101
ClassSignalSynchronizer = 0x1110
ClassSignalOther = 0x1180
ClassOthers = 0xff
)
// ClassNames maps class names from PCI sysfs to a name.
var ClassNames = map[uint32]string{
0x000000: "NotDefined",
0x000100: "NotDefinedVGA",
0x01: "Storage",
0x010000: "StorageSCSI",
0x010100: "StorageIDE",
0x010200: "StorageFLOPPY",
0x010300: "StorageIPI",
0x010400: "StorageRAID",
0x010500: "StorageATA",
0x010600: "StorageSATA",
0x010700: "StorageSAS",
0x018000: "StorageOther",
0x02: "Network",
0x020000: "NetworkEthernet",
0x028000: "NetworkOther",
0x03: "Display",
0x030000: "DisplayVGA",
0x030100: "DisplayXGA",
0x030200: "Display3D",
0x038000: "DisplayOther",
0x04: "Multimedia",
0x040000: "MultimediaVideo",
0x040100: "MultimediaAudio",
0x040200: "MultimediaPhone",
0x040300: "MultimediaAudioDev",
0x048000: "MultimediaOther",
0x05: "Memory",
0x050000: "MemoryRAM",
0x050100: "MemoryFLASH",
0x058000: "MemoryOther",
0x06: "Bridge",
0x060000: "BridgeHost",
0x060100: "BridgeISA",
0x060200: "BridgeEISA",
0x060300: "BridgeMC",
0x060400: "BridgePCI",
0x060500: "BridgePCMCIA",
0x060600: "BridgeNUBUS",
0x060700: "BridgeCARDBUS",
0x060800: "BridgeRACEWAY",
0x060900: "BridgePCISemi",
0x060a00: "BridgeIBToPCI",
0x068000: "BridgeOther",
0x07: "Communication",
0x070000: "CommunicationSerial",
0x070100: "CommunicationParallel",
0x070200: "CommunicationMSerial",
0x070300: "CommunicationModem",
0x078000: "CommunicationOther",
0x08: "System",
0x080000: "SystemPIC",
0x080100: "SystemDMA",
0x080200: "SystemTimer",
0x080300: "SystemRTC",
0x080400: "SystemPCIHotplug",
0x088000: "SystemOther",
0x09: "Input",
0x090000: "InputKeyboard",
0x090100: "InputPen",
0x090200: "InputMouse",
0x090300: "InputScanner",
0x090400: "InputGameport",
0x098000: "InputOther",
0x0a: "Docking",
0x0a0000: "DockingGeneric",
0x0a8000: "DockingOther",
0x0b: "Processor",
0x0b0000: "Processor386",
0x0b0100: "Processor486",
0x0b0200: "ProcessorPentium",
0x0b1000: "ProcessorALPHA",
0x0b2000: "ProcessorPOWERPC",
0x0b3000: "ProcessorMIPS",
0x0b4000: "ProcessorCO",
0x0c: "Serial",
0x0c0000: "SerialFirewire",
0x0c0100: "SerialAccess",
0x0c0200: "SerialSSA",
0x0c0300: "SerialUSB",
0x0c0400: "SerialFIBER",
0x0c0500: "SerialSMBUS",
0x0c0600: "SerialINFINIBAND",
0x0d: "Wireless",
0x0d0000: "WirelessIRDA",
0x0d0100: "WirelessCONSUMERIR",
0x0d1000: "WirelessRF",
0x0d8000: "WirelessOther",
0x0f: "Satellite",
0x0f0000: "SatelliteTV",
0x0f0100: "SatelliteAudio",
0x0f0300: "SatelliteVoice",
0x0f0400: "SatelliteData",
0x10: "Crypt",
0x100000: "CryptNetwork",
0x101000: "CryptEntertainment",
0x108000: "CryptOther",
0x11: "Signal",
0x110000: "SignalDPIO",
0x110100: "SignalPERFCTR",
0x111000: "SignalSynchronizer",
0x118000: "SignalOther",
0xff: "Others",
}
|
borisboychev/SoftUni
|
Python_Advanced_Softuni/Modules_Lab/venv/05.fib_sequence.py
|
<reponame>borisboychev/SoftUni<filename>Python_Advanced_Softuni/Modules_Lab/venv/05.fib_sequence.py
from fibonacci_sequence.sequence import create_sequence , locate
create_sequence(9)
locate(1)
|
rdtr/lamvery
|
lamvery/env.py
|
<reponame>rdtr/lamvery
# -*- coding: utf-8 -*-
import json
import os
ENV_FILE_NAME = '.lamvery_env.json'
def load():
try:
env = json.load(open(ENV_FILE_NAME, 'r'))
for k, v in env.items():
os.environ.setdefault(k, v)
except:
pass
|
byu-oit/cas-mfa
|
cas-mfa-java/src/main/java/net/unicon/cas/mfa/MultiFactorAwareCentralAuthenticationService.java
|
<reponame>byu-oit/cas-mfa<gh_stars>0
package net.unicon.cas.mfa;
import com.codahale.metrics.annotation.Counted;
import com.codahale.metrics.annotation.Metered;
import com.codahale.metrics.annotation.Timed;
import org.jasig.cas.authentication.Credential;
import org.jasig.cas.authentication.handler.AuthenticationException;
import org.jasig.cas.ticket.Ticket;
import org.jasig.inspektr.audit.annotation.Audit;
import net.unicon.cas.mfa.authentication.principal.MultiFactorCredentials;
import net.unicon.cas.mfa.util.MultiFactorUtils;
import net.unicon.cas.mfa.web.support.MultiFactorAuthenticationSupportingWebApplicationService;
import org.apache.commons.lang3.StringUtils;
import org.jasig.cas.CentralAuthenticationService;
import org.jasig.cas.authentication.Authentication;
import org.jasig.cas.authentication.AuthenticationManager;
import org.jasig.cas.authentication.MutableAuthentication;
import org.jasig.cas.authentication.principal.Credentials;
import org.jasig.cas.authentication.principal.PersistentIdGenerator;
import org.jasig.cas.authentication.principal.Principal;
import org.jasig.cas.authentication.principal.Service;
import org.jasig.cas.authentication.principal.ShibbolethCompatiblePersistentIdGenerator;
import org.jasig.cas.authentication.principal.SimplePrincipal;
import org.jasig.cas.services.RegisteredService;
import org.jasig.cas.services.ServicesManager;
import org.jasig.cas.services.UnauthorizedServiceException;
import org.jasig.cas.ticket.ExpirationPolicy;
import org.jasig.cas.ticket.InvalidTicketException;
import org.jasig.cas.ticket.ServiceTicket;
import org.jasig.cas.ticket.TicketException;
import org.jasig.cas.ticket.TicketGrantingTicket;
import org.jasig.cas.ticket.TicketGrantingTicketImpl;
import org.jasig.cas.ticket.TicketValidationException;
import org.jasig.cas.ticket.registry.TicketRegistry;
import org.jasig.cas.util.UniqueTicketIdGenerator;
import org.jasig.cas.validation.Assertion;
import org.jasig.cas.validation.ImmutableAssertionImpl;
import org.jasig.inspektr.audit.annotation.Audit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* An extension of {@link CentralAuthenticationService} that routes CAS requests to a delegate,
* thereby allowing the ability to partially override behavior that is MFA specific.
* The current implementation is specific on the operation of creating ticket creating tickets
* based on the assumptions that the credentials received are of type {@link MultiFactorCredentials}
* and that the authentication context is verified and readily available, based on which the TGT will
* be added to the configured {@link TicketRegistry}.
*
* This implementation here is merely responsible for creating the ticket granting ticket
* and again, assumes that the authentication context has been established by all other
* authentication managers in the flow. The authentication context is carried within the
* {@link MultiFactorCredentials} instance.
*
* Assumptions: the TicketRegistry wired into this CentralAuthenticationService instance is the same as that wired
* into the wrapped delegate.
* (That way when this implementation adds tickets directly to the registry in createTGT and delegateTGT
* those tickets will be available to the delegate in its fulfilling such methods as grantServiceTicket.)
*
*
* @author <NAME>
*/
public final class MultiFactorAwareCentralAuthenticationService implements CentralAuthenticationService {
/** Log instance for logging events, info, warnings, errors, etc. */
private final Logger logger = LoggerFactory.getLogger(this.getClass());
/** The wrapped CentralAuthenticationService. */
private CentralAuthenticationService delegate;
private UniqueTicketIdGenerator ticketGrantingTicketUniqueTicketIdGenerator;
private TicketRegistry ticketRegistry;
private ExpirationPolicy ticketGrantingTicketExpirationPolicy;
private AuthenticationManager authenticationManager;
/** New Ticket Registry for storing and retrieving services tickets. Can point to the same one as the ticketRegistry variable. */
@NotNull
private TicketRegistry serviceTicketRegistry;
/** Encoder to generate PseudoIds. */
@NotNull
private PersistentIdGenerator persistentIdGenerator = new ShibbolethCompatiblePersistentIdGenerator();
/** The authentication method attribute name to include in the response. **/
@NotNull
private String authenticationMethodAttributeName = MultiFactorAuthenticationSupportingWebApplicationService.CONST_PARAM_AUTHN_METHOD;
/** Implementation of Service Manager. */
@NotNull
private ServicesManager servicesManager;
@Override
@Audit(
action="TICKET_GRANTING_TICKET",
actionResolverName="CREATE_TICKET_GRANTING_TICKET_RESOLVER",
resourceResolverName="CREATE_TICKET_GRANTING_TICKET_RESOURCE_RESOLVER")
@Timed(name = "CREATE_TICKET_GRANTING_TICKET_TIMER")
@Metered(name = "CREATE_TICKET_GRANTING_TICKET_METER")
@Counted(name="CREATE_TICKET_GRANTING_TICKET_COUNTER", monotonic=true)
public TicketGrantingTicket createTicketGrantingTicket(final Credential... credentials) throws TicketException {
final MultiFactorCredentials mfaCredentials = (MultiFactorCredentials) credentials;
final Authentication authentication = mfaCredentials.getAuthentication();
final TicketGrantingTicket ticketGrantingTicket = new TicketGrantingTicketImpl(
this.ticketGrantingTicketUniqueTicketIdGenerator.getNewTicketId(TicketGrantingTicket.PREFIX), authentication,
this.ticketGrantingTicketExpirationPolicy);
this.ticketRegistry.addTicket(ticketGrantingTicket);
return ticketGrantingTicket;
}
@Timed(name = "GET_TICKET_TIMER")
@Metered(name = "GET_TICKET_METER")
@Counted(name="GET_TICKET_COUNTER", monotonic=true)
@Override
public <T extends Ticket> T getTicket(final String ticketId, final Class<? extends Ticket> clazz)
throws InvalidTicketException {
return delegate.getTicket(ticketId, clazz);
}
/*
* Implements Audit Trail participation by virtue of the delegate's audit trail participation.
*/
@Override
public ServiceTicket grantServiceTicket(final String ticketGrantingTicketId, final Service service)
throws AuthenticationException, TicketException{
return this.delegate.grantServiceTicket(ticketGrantingTicketId, service, null);
}
/*
* Implements Audit Trail participation by virtue of the delegate's audit trail participation.
*/
@Override
public ServiceTicket grantServiceTicket(final String ticketGrantingTicketId, final Service service, final Credential... credentials)
throws TicketException {
return this.delegate.grantServiceTicket(ticketGrantingTicketId, service, credentials);
}
/*
* Implements Audit Trail participation by virtue of the delegate's audit trail participation.
*/
@Override
@Audit(
action="SERVICE_TICKET_VALIDATE",
actionResolverName="VALIDATE_SERVICE_TICKET_RESOLVER",
resourceResolverName="VALIDATE_SERVICE_TICKET_RESOURCE_RESOLVER")
@Profiled(tag="VALIDATE_SERVICE_TICKET", logFailuresSeparately = false)
public Assertion validateServiceTicket(final String serviceTicketId, final Service service) throws TicketException {
Assert.notNull(serviceTicketId, "serviceTicketId cannot be null");
Assert.notNull(service, "service cannot be null");
final ServiceTicket serviceTicket = (ServiceTicket) this.serviceTicketRegistry.getTicket(serviceTicketId, ServiceTicket.class);
final RegisteredService registeredService = this.servicesManager.findServiceBy(service);
if (registeredService == null || !registeredService.isEnabled()) {
logger.warn("ServiceManagement: Service {} does not exist or is not enabled in registry.", service);
throw new UnauthorizedServiceException("Service not allowed to validate tickets.");
}
if (serviceTicket == null) {
logger.info("ServiceTicket [" + serviceTicketId + "] does not exist.");
throw new InvalidTicketException();
}
try {
synchronized (serviceTicket) {
if (serviceTicket.isExpired()) {
logger.info("ServiceTicket [" + serviceTicketId + "] has expired.");
throw new InvalidTicketException();
}
if (!serviceTicket.isValidFor(service)) {
logger.error("ServiceTicket {} with service {} does not match supplied service {}",
serviceTicketId, serviceTicket.getService().getId(), service);
throw new TicketValidationException(serviceTicket.getService());
}
}
final List<Authentication> chainedAuthenticationsList = serviceTicket.getGrantingTicket().getChainedAuthentications();
final Authentication authentication = chainedAuthenticationsList.get(chainedAuthenticationsList.size() - 1);
final Principal principal = authentication.getPrincipal();
final String principalId = determinePrincipalIdForRegisteredService(principal, registeredService, serviceTicket);
final Authentication authToUse;
if (!registeredService.isIgnoreAttributes()) {
final Map<String, Object> attributes = new HashMap<String, Object>();
for (final String attribute : registeredService.getAllowedAttributes()) {
final Object value = principal.getAttributes().get(attribute);
if (value != null) {
attributes.put(attribute, value);
}
}
final String authnMethod = MultiFactorUtils.getFulfilledAuthenticationMethodsAsString(authentication);
if (StringUtils.isNotBlank(authnMethod)) {
attributes.put(this.authenticationMethodAttributeName, authnMethod);
}
final Principal modifiedPrincipal = new SimplePrincipal(principalId, attributes);
final MutableAuthentication mutableAuthentication = new MutableAuthentication(
modifiedPrincipal, authentication.getAuthenticatedDate());
mutableAuthentication.getAttributes().putAll(
authentication.getAttributes());
mutableAuthentication.getAuthenticatedDate().setTime(
authentication.getAuthenticatedDate().getTime());
authToUse = mutableAuthentication;
} else {
final Map<String, Object> attributes = new HashMap<String, Object>(principal.getAttributes());
final String authnMethod = MultiFactorUtils.getFulfilledAuthenticationMethodsAsString(authentication);
if (StringUtils.isNotBlank(authnMethod)) {
attributes.put(this.authenticationMethodAttributeName, authnMethod);
}
final Principal modifiedPrincipal = new SimplePrincipal(principalId, attributes);
authToUse = new MutableAuthentication(modifiedPrincipal, authentication.getAuthenticatedDate());
}
final List<Authentication> authentications = new ArrayList<Authentication>();
for (int i = 0; i < chainedAuthenticationsList.size() - 1; i++) {
authentications.add(serviceTicket.getGrantingTicket().getChainedAuthentications().get(i));
}
authentications.add(authToUse);
return new ImmutableAssertionImpl(authentications, serviceTicket.getService(), serviceTicket.isFromNewLogin());
} finally {
if (serviceTicket.isExpired()) {
this.serviceTicketRegistry.deleteTicket(serviceTicketId);
}
}
}
/*
* Implements Audit Trail participation by virtue of the delegate's audit trail participation.
*/
@Override
public void destroyTicketGrantingTicket(final String ticketGrantingTicketId) {
this.delegate.destroyTicketGrantingTicket(ticketGrantingTicketId);
}
@Override
@Audit(
action="PROXY_GRANTING_TICKET",
actionResolverName="GRANT_PROXY_GRANTING_TICKET_RESOLVER",
resourceResolverName="GRANT_PROXY_GRANTING_TICKET_RESOURCE_RESOLVER")
@Profiled(tag="GRANT_PROXY_GRANTING_TICKET", logFailuresSeparately = false)
public String delegateTicketGrantingTicket(final String serviceTicketId, final Credential credentials) throws TicketException {
return this.delegate.delegateTicketGrantingTicket(serviceTicketId, credentials);
}
/**
* Determines the principal id to use for a {@link RegisteredService} using the following rules:
*
* <ul>
* <li> If the service is marked to allow anonymous access, a persistent id is returned. </li>
* <li> If the attribute name is undefined, then the default principal id is returned.</li>
* <li>If the service is set to ignore attributes, or the username attribute exists in the allowed attributes for the service,
* the corresponding attribute value will be returned.
* </li>
* <li>Otherwise, the default principal's id is returned as the username attribute with an additional warning.</li>
* </ul>
*
* @param principal The principal object to be validated and constructed
* @param registeredService Requesting service for which a principal is being validated.
* @param serviceTicket An instance of the service ticket used for validation
*
* @return The principal id to use for the requesting registered service
*/
private String determinePrincipalIdForRegisteredService(final Principal principal, final RegisteredService registeredService,
final ServiceTicket serviceTicket) {
String principalId = null;
final String serviceUsernameAttribute = registeredService.getUsernameAttribute();
if (registeredService.isAnonymousAccess()) {
principalId = this.persistentIdGenerator.generate(principal, serviceTicket.getService());
} else if (StringUtils.isBlank(serviceUsernameAttribute)) {
principalId = principal.getId();
} else {
if ((registeredService.isIgnoreAttributes() || registeredService.getAllowedAttributes().contains(serviceUsernameAttribute))
&& principal.getAttributes().containsKey(serviceUsernameAttribute)) {
principalId = principal.getAttributes().get(registeredService.getUsernameAttribute()).toString();
} else {
principalId = principal.getId();
final Object[] errorLogParameters = new Object[] {principalId, registeredService.getUsernameAttribute(),
principal.getAttributes(), registeredService.getServiceId(), principalId };
logger.warn("Principal [{}] did not have attribute [{}] among attributes [{}] so CAS cannot "
+ "provide on the validation response the user attribute the registered service [{}] expects. "
+ "CAS will instead return the default username attribute [{}]", errorLogParameters);
}
}
logger.debug("Principal id to return for service [{}] is [{}]. The default principal id is [{}].",
registeredService.getName(), principal.getId(), principalId);
return principalId;
}
public void setAuthenticationManager(final AuthenticationManager manager) {
this.authenticationManager = manager;
}
/**
* The set TicketRegistry should be the same registry used by the CentralAuthenticationService instance
* provided to setCentralAuthenticationServiceDelegate.
* @param ticketRegistry non-null TicketRegistry shared with the delegate CAS
*/
/**
* Method to set the TicketRegistry.
*
* @param ticketRegistry the TicketRegistry to set.
*/
public void setTicketRegistry(final TicketRegistry ticketRegistry) {
this.ticketRegistry = ticketRegistry;
if (this.serviceTicketRegistry == null) {
this.serviceTicketRegistry = ticketRegistry;
}
}
public void setServiceTicketRegistry(final TicketRegistry serviceTicketRegistry) {
this.serviceTicketRegistry = serviceTicketRegistry;
}
/**
* Inject a ticket granting ticket expiration policy.
* @param ticketGrantingTicketExpirationPolicy the non-null policy on TGT expiration.
*/
public void setTicketGrantingTicketExpirationPolicy(final ExpirationPolicy ticketGrantingTicketExpirationPolicy) {
this.ticketGrantingTicketExpirationPolicy = ticketGrantingTicketExpirationPolicy;
}
public void setServicesManager(final ServicesManager servicesManager) {
this.servicesManager = servicesManager;
}
/**
* Inject a TGT unique ID generator.
* @param uniqueTicketIdGenerator the non-null TGT unique ID generator.
*/
public void setTicketGrantingTicketUniqueTicketIdGenerator(final UniqueTicketIdGenerator uniqueTicketIdGenerator) {
this.ticketGrantingTicketUniqueTicketIdGenerator = uniqueTicketIdGenerator;
}
/**
* Inject a delegate CAS implementation to fulfill the non-TGT-creating CAS API methods.
* The delegate CAS instance should share a TicketRegistry with this CAS instance otherwise this CAS will be
* granting TGTs that will not be honored by the delegate.
* @param cas the non-null delegate CAS
*/
public void setCentralAuthenticationServiceDelegate(final CentralAuthenticationService cas) {
this.delegate = cas;
}
/**
* Sets authentication method attribute name.
*
* @param authenticationMethodAttributeName the authentication method attribute name
*/
public void setAuthenticationMethodAttributeName(final String authenticationMethodAttributeName) {
this.authenticationMethodAttributeName = authenticationMethodAttributeName;
}
public void setPersistentIdGenerator(final PersistentIdGenerator persistentIdGenerator) {
this.persistentIdGenerator = persistentIdGenerator;
}
}
|
fkrasnowski/portfolio-page
|
src/components/svg/shapes.js
|
<reponame>fkrasnowski/portfolio-page
import React from "react"
import {
HeatGradient,
MilkibloodGradient,
WaterGradient,
Gradient,
} from "./gardients"
import { css } from "@emotion/core"
import { useTheme } from "emotion-theming"
export function Triangle({ id }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="98"
height="96"
fill="url(#heat-gradient)"
viewBox="0 0 98 96"
id={id}
>
<HeatGradient />
<path
// fill="#C4C4C4"
d="M23.852 11.2c1.506-6.763 9.768-9.359 14.872-4.673l53.584 49.201c5.103 4.686 3.22 13.14-3.39 15.216L19.517 92.749c-6.61 2.076-12.989-3.781-11.482-10.544L23.852 11.2z"
></path>
</svg>
)
}
export function Circle({ id }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="100"
height="100"
fill="url(#milkiblood-gradient)"
viewBox="0 0 100 100"
id={id}
>
<MilkibloodGradient />
<circle cx="50" cy="50" r="41"></circle>
</svg>
)
}
export function Square({ id }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="100"
height="100"
fill="url(#water-gradient)"
viewBox="0 0 100 100"
id={id}
>
<WaterGradient />
<rect
width="74"
height="74"
x="29.44"
y="1.883"
rx="9"
transform="rotate(21.863 29.44 1.883)"
/>
</svg>
)
}
export function Pentagon({ id }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="100"
height="100"
fill="url(#sunshine-gradient)"
viewBox="0 0 100 100"
transform="scale(1.2)"
id={id}
>
<Gradient />
<path d="M55.23 12.835a9 9 0 0110.186 2.863L87.913 44.18a9 9 0 01.425 10.572L68.201 84.95a9 9 0 01-9.923 3.671l-34.942-9.82a9 9 0 01-6.558-8.302L15.32 34.232a9 9 0 015.87-8.803l34.04-12.594z"></path>
</svg>
)
}
export const Shape = ({ type, id }) => {
switch (type) {
case "circle":
return <Circle id={id} />
case "triangle":
return <Triangle id={id} />
case "square":
return <Square id={id} />
case "pentagon":
return <Pentagon id={id} />
default:
return <Triangle id={id} />
}
}
export function Wave({ scaleY }) {
const theme = useTheme()
const h = 400
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="100%"
height={h + "px"}
// style={{ scaleY: h }}
fill={theme.colors.accent}
preserveAspectRatio="none"
viewBox="0 0 294 138"
css={css`
position: relative;
top: -${h / 2}px;
transition: height 0.05s;
z-index: -1;
margin-bottom: -200px;
`}
style={{ transform: `scaleY(${scaleY})` }}
>
<path d="M0-5h295.5s.434 101.589-3.047 114.5c-3.482 12.911-5.969 15.678-15.419 0s-24.868-29.428-44.266 0c-19.397 29.428-64.16 45.19-91.018 0-26.858-45.19-35.254-41.53-74.605 0-20.669 23.02-29.734 24.16-40.287 0C17.97 93.826 11.935 95.335 0 109.5V-5z"></path>
</svg>
)
}
|
Nikoula86/organoidSegment
|
morgana/ImageTools/fluorescence/computefluorescence.py
|
import numpy as np
import pandas as pd
import os, tqdm
from scipy.ndimage import map_coordinates
from skimage.io import imread
from scipy.ndimage import label
from skimage import measure, img_as_bool
if __name__ == '__main__':
import sys
sys.path.append(os.path.join('..','..'))
from morgana.ImageTools.morphology import meshgrid
from morgana.ImageTools.fluorescence import computeprofiles
def compute_fluorescence_info( image, mask, f_in, f_ma, prop, parent_folder = '' ):
if image is None:
# load image
path_to_file = os.path.join(parent_folder,f_in)
image = imread(path_to_file)
if image.ndim == 2:
image = np.expand_dims(image,0)
if image.shape[-1] == np.min(image.shape):
image = np.moveaxis(image, -1, 0)
image = np.stack([ img[prop['slice']].astype(np.float) for img in image ])
if mask is None:
# load mask
path_to_mask = os.path.join(parent_folder,f_ma)
mask = img_as_bool( imread(path_to_mask)[prop['slice']].astype(np.float) )
# make sure the input image is a 3D numpy array even if it has only one channel
N_ch = image.shape[0]
# setup the dictionary
dict_ = {}
dict_['input_file'] = prop['input_file']
dict_['mask_file'] = prop['mask_file']
for ch in range(N_ch):
dict_['ch%d_APprofile'%ch] = []
dict_['ch%d_LRprofile'%ch] = []
dict_['ch%d_RADprofile'%ch] = []
dict_['ch%d_ANGprofile'%ch] = []
dict_['ch%d_Background'%ch] = []
dict_['ch%d_Average'%ch] = []
# compute meshgrid if not computed in the previous step already
tangent = prop['tangent']
midline = prop['midline']
width = prop['meshgrid_width']
mesh = prop['meshgrid']
if mesh == None:
mesh = meshgrid.compute_meshgrid(
midline,
tangent,
width
)
for ch in range(N_ch):
fl = image[ch]
# compute average and background in the current channel
dict_['ch%d_Background'%ch] = np.mean(fl[mask==0])
dict_['ch%d_Average'%ch] = np.mean(fl[mask])
# compute meshgrid and straighten
ap, lr, rad, ang = computeprofiles.compute_profiles_fluo(fl, mask, mesh, visualize=False)
for j, v in enumerate(ap):
if not np.isfinite(v):
ap[j] = 0
# make the nans equal to the first or last finite element
left = np.array(ap)[np.array(ap)>0][0]
right = np.array(ap)[np.array(ap)>0][-1]
for j, v in enumerate(ap):
if v==0 and (j<(len(ap)/2)):
ap[j] = left
if v==0 and (j>(len(ap)/2)):
ap[j] = right
dict_['ch%d_APprofile'%ch] = ap
dict_['ch%d_LRprofile'%ch] = lr
dict_['ch%d_RADprofile'%ch] = rad
dict_['ch%d_ANGprofile'%ch] = ang
# transform the sub dictionary into a dataframe
# dict_['ch%d'%ch] = pd.Series(dict_['ch%d'%ch])
return pd.Series( dict_ )
if __name__ == '__main__':
import DatasetTools.morphology.io
input_folder = os.path.join('..','..','..','..','..','gastrSegment_testData','2020-02-20_David_TL','g03G')
save_folder = os.path.join(input_folder, 'result_segmentation')
cond = 'g03G'
props = DatasetTools.morphology.io.load_morpho_params( save_folder, cond )
# compute for the first image
i = 0
prop = {key: props[key][i] for key in props.keys()}
f_ma = prop['mask_file']
f_in = prop['input_file']
# load input image and mask
path_to_mask = os.path.join(input_folder,f_ma)
path_to_file = os.path.join(input_folder,f_in)
mask = img_as_bool( imread(path_to_mask)[prop['slice']].astype(np.float) )
image = imread(path_to_file)
image = np.stack([ img[prop['slice']].astype(np.float) for img in image ])
# make sure the input image is a 3D numpy array even if it has only one channel
if image.ndim == 2:
image = np.expand_dims(image,0)
if image.shape[-1] == np.min(image.shape):
image = np.moveaxis(image, -1, 0)
N_ch = image.shape[0]
# compute all fluorescenc eproperties
prop = compute_fluorescence_info(image, mask, f_in, f_ma, prop)
print(prop)
|
WDeepali/blockchaindemo
|
vendor/github.com/manudrijvers/amcl/go/GCM.go
|
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
/*
* Implementation of the AES-GCM Encryption/Authentication
*
* Some restrictions..
* 1. Only for use with AES
* 2. Returned tag is always 128-bits. Truncate at your own risk.
* 3. The order of function calls must follow some rules
*
* Typical sequence of calls..
* 1. call GCM_init
* 2. call GCM_add_header any number of times, as long as length of header is multiple of 16 bytes (block size)
* 3. call GCM_add_header one last time with any length of header
* 4. call GCM_add_cipher any number of times, as long as length of cipher/plaintext is multiple of 16 bytes
* 5. call GCM_add_cipher one last time with any length of cipher/plaintext
* 6. call GCM_finish to extract the tag.
*
* See http://www.mindspring.com/~dmcgrew/gcm-nist-6.pdf
*/
package amcl
import
(
// "fmt"
"strconv"
)
const gcm_NB int=4
const GCM_ACCEPTING_HEADER int=0
const GCM_ACCEPTING_CIPHER int=1
const GCM_NOT_ACCEPTING_MORE int=2
const GCM_FINISHED int=3
const GCM_ENCRYPTING int=0
const GCM_DECRYPTING int=1
type GCM struct {
table [128][4]uint32 /* 2k bytes */
stateX [16]byte
Y_0 [16]byte
counter int
lenA [2]uint32
lenC [2]uint32
status int
a *AES
}
func gcm_pack(b [4]byte) uint32 { /* pack bytes into a 32-bit Word */
return ((uint32(b[0])&0xff)<<24)|((uint32(b[1])&0xff)<<16)|((uint32(b[2])&0xff)<<8)|(uint32(b[3])&0xff)
}
func gcm_unpack(a uint32) [4]byte { /* unpack bytes from a word */
var b=[4]byte{byte((a>>24)&0xff),byte((a>>16)&0xff),byte((a>>8)&0xff),byte(a&0xff)}
return b;
}
func (G *GCM) precompute(H []byte) {
var b [4]byte
j:=0
for i:=0;i<gcm_NB;i++ {
b[0]=H[j]; b[1]=H[j+1]; b[2]=H[j+2]; b[3]=H[j+3]
G.table[0][i]=gcm_pack(b);
j+=4
}
for i:=1;i<128;i++ {
c:=uint32(0)
for j:=0;j<gcm_NB;j++ {G.table[i][j]=c|(G.table[i-1][j])>>1; c=G.table[i-1][j]<<31;}
if c != 0 {G.table[i][0]^=0xE1000000} /* irreducible polynomial */
}
}
func (G *GCM) gf2mul() { /* gf2m mul - Z=H*X mod 2^128 */
var P [4]uint32
for i:=0;i<4;i++ {P[i]=0}
j:=uint(8); m:=0
for i:=0;i<128;i++ {
j--
c:=uint32((G.stateX[m]>>j)&1); c=^c+1
for k:=0;k<gcm_NB;k++ {P[k]^=(G.table[i][k]&c)}
if j==0 {
j=8; m++;
if m==16 {break}
}
}
j=0
for i:=0;i<gcm_NB;i++ {
b:=gcm_unpack(P[i])
G.stateX[j]=b[0]; G.stateX[j+1]=b[1]; G.stateX[j+2]=b[2]; G.stateX[j+3]=b[3];
j+=4
}
}
func (G *GCM) wrap() { /* Finish off GHASH */
var F [4]uint32
var L [16]byte
/* convert lengths from bytes to bits */
F[0]=(G.lenA[0]<<3)|(G.lenA[1]&0xE0000000)>>29
F[1]=G.lenA[1]<<3
F[2]=(G.lenC[0]<<3)|(G.lenC[1]&0xE0000000)>>29
F[3]=G.lenC[1]<<3
j:=0
for i:=0;i<gcm_NB;i++ {
b:=gcm_unpack(F[i]);
L[j]=b[0]; L[j+1]=b[1]; L[j+2]=b[2]; L[j+3]=b[3]
j+=4
}
for i:=0;i<16;i++ {G.stateX[i]^=L[i]}
G.gf2mul()
}
func (G *GCM) ghash(plain []byte,len int) bool {
if G.status==GCM_ACCEPTING_HEADER {G.status=GCM_ACCEPTING_CIPHER}
if G.status != GCM_ACCEPTING_CIPHER {return false}
j:=0
for (j<len) {
for i:=0;i<16 && j<len;i++ {
G.stateX[i]^=plain[j]; j++
G.lenC[1]++; if G.lenC[1]==0 {G.lenC[0]++}
}
G.gf2mul();
}
if len%16 != 0 {G.status=GCM_NOT_ACCEPTING_MORE}
return true;
}
/* Initialize GCM mode */
func (G *GCM) Init(nk int,key []byte,niv int,iv []byte) { /* iv size niv is usually 12 bytes (96 bits). AES key size nk can be 16,24 or 32 bytes */
var H [16]byte
for i:=0;i<16;i++ {H[i]=0; G.stateX[i]=0}
G.a=new(AES)
G.a.Init(aes_ECB,nk,key,iv)
G.a.ecb_encrypt(H[:]) /* E(K,0) */
G.precompute(H[:])
G.lenA[0]=0;G.lenC[0]=0;G.lenA[1]=0;G.lenC[1]=0
if niv==12 {
for i:=0;i<12;i++ {G.a.f[i]=iv[i]}
b:=gcm_unpack(uint32(1))
G.a.f[12]=b[0]; G.a.f[13]=b[1]; G.a.f[14]=b[2]; G.a.f[15]=b[3]; /* initialise IV */
for i:=0;i<16;i++ {G.Y_0[i]=G.a.f[i]}
} else {
G.status=GCM_ACCEPTING_CIPHER;
G.ghash(iv,niv) /* GHASH(H,0,IV) */
G.wrap()
for i:=0;i<16;i++ {G.a.f[i]=G.stateX[i];G.Y_0[i]=G.a.f[i];G.stateX[i]=0}
G.lenA[0]=0;G.lenC[0]=0;G.lenA[1]=0;G.lenC[1]=0
}
G.status=GCM_ACCEPTING_HEADER
}
/* Add Header data - included but not encrypted */
func (G *GCM) Add_header(header []byte,len int) bool { /* Add some header. Won't be encrypted, but will be authenticated. len is length of header */
if G.status != GCM_ACCEPTING_HEADER {return false}
j:=0
for j<len {
for i:=0;i<16 && j<len;i++ {
G.stateX[i]^=header[j]; j++
G.lenA[1]++; if G.lenA[1]==0 {G.lenA[0]++}
}
G.gf2mul();
}
if len%16 != 0 {G.status=GCM_ACCEPTING_CIPHER}
return true;
}
/* Add Plaintext - included and encrypted */
func (G *GCM) Add_plain(plain []byte,len int) []byte {
var B [16]byte
var b [4]byte
cipher:=make([]byte,len)
var counter uint32=0
if G.status == GCM_ACCEPTING_HEADER {G.status=GCM_ACCEPTING_CIPHER}
if G.status != GCM_ACCEPTING_CIPHER {return nil}
j:=0
for j<len {
b[0]=G.a.f[12]; b[1]=G.a.f[13]; b[2]=G.a.f[14]; b[3]=G.a.f[15];
counter=gcm_pack(b)
counter++
b=gcm_unpack(counter)
G.a.f[12]=b[0]; G.a.f[13]=b[1]; G.a.f[14]=b[2]; G.a.f[15]=b[3] /* increment counter */
for i:=0;i<16;i++ {B[i]=G.a.f[i]}
G.a.ecb_encrypt(B[:]); /* encrypt it */
for i:=0;i<16 && j<len;i++ {
cipher[j]=(plain[j]^B[i])
G.stateX[i]^=cipher[j]; j++
G.lenC[1]++; if G.lenC[1]==0 {G.lenC[0]++}
}
G.gf2mul()
}
if len%16 != 0 {G.status=GCM_NOT_ACCEPTING_MORE}
return cipher
}
/* Add Ciphertext - decrypts to plaintext */
func (G *GCM) Add_cipher(cipher []byte,len int) []byte {
var B [16]byte
var b [4]byte
plain:=make([]byte,len)
var counter uint32=0
if G.status==GCM_ACCEPTING_HEADER {G.status=GCM_ACCEPTING_CIPHER}
if G.status != GCM_ACCEPTING_CIPHER {return nil}
j:=0
for j<len {
b[0]=G.a.f[12]; b[1]=G.a.f[13]; b[2]=G.a.f[14]; b[3]=G.a.f[15]
counter=gcm_pack(b);
counter++
b=gcm_unpack(counter)
G.a.f[12]=b[0]; G.a.f[13]=b[1]; G.a.f[14]=b[2]; G.a.f[15]=b[3]; /* increment counter */
for i:=0;i<16;i++ {B[i]=G.a.f[i]}
G.a.ecb_encrypt(B[:]) /* encrypt it */
for i:=0;i<16 && j<len;i++ {
oc:=cipher[j];
plain[j]=(cipher[j]^B[i])
G.stateX[i]^=oc; j++
G.lenC[1]++; if G.lenC[1]==0 {G.lenC[0]++}
}
G.gf2mul()
}
if len%16 != 0 {G.status=GCM_NOT_ACCEPTING_MORE}
return plain
}
/* Finish and extract Tag */
func (G *GCM) Finish(extract bool) [16]byte { /* Finish off GHASH and extract tag (MAC) */
var tag [16]byte
G.wrap()
/* extract tag */
if extract {
G.a.ecb_encrypt(G.Y_0[:]); /* E(K,Y0) */
for i:=0;i<16;i++ {G.Y_0[i]^=G.stateX[i]}
for i:=0;i<16;i++ {tag[i]=G.Y_0[i];G.Y_0[i]=0;G.stateX[i]=0}
}
G.status=GCM_FINISHED
G.a.End()
return tag
}
func hex2bytes(s string) []byte {
lgh:=len(s)
data:=make([]byte,lgh/2)
for i:=0;i<lgh;i+=2 {
a,_ := strconv.ParseInt(s[i:i+2],16,32)
data[i/2]=byte(a)
}
return data
}
/*
func main() {
KT:="feffe9928665731c6d6a8f9467308308"
MT:="d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39"
HT:="feedfacedeadbeeffeedfacedeadbeefabaddad2"
NT:="9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b";
// Tag should be 619cc5aefffe0bfa462af43c1699d050
g:=new(GCM)
M:=hex2bytes(MT)
H:=hex2bytes(HT)
N:=hex2bytes(NT)
K:=hex2bytes(KT)
lenM:=len(M)
lenH:=len(H)
lenK:=len(K)
lenIV:=len(N)
fmt.Printf("Plaintext=\n");
for i:=0;i<lenM;i++ {fmt.Printf("%02x",M[i])}
fmt.Printf("\n")
g.Init(lenK,K,lenIV,N)
g.Add_header(H,lenH)
C:=g.Add_plain(M,lenM)
T:=g.Finish(true)
fmt.Printf("Ciphertext=\n")
for i:=0;i<lenM;i++ {fmt.Printf("%02x",C[i])}
fmt.Printf("\n")
fmt.Printf("Tag=\n")
for i:=0;i<16;i++ {fmt.Printf("%02x",T[i])}
fmt.Printf("\n")
g.Init(lenK,K,lenIV,N)
g.Add_header(H,lenH)
P:=g.Add_cipher(C,lenM)
T=g.Finish(true)
fmt.Printf("Plaintext=\n");
for i:=0;i<lenM;i++ {fmt.Printf("%02x",P[i])}
fmt.Printf("\n")
fmt.Printf("Tag=\n");
for i:=0;i<16;i++ {fmt.Printf("%02x",T[i])}
fmt.Printf("\n")
}
*/
|
RocMarshal/fevernova
|
src/main/java/com/github/fevernova/io/data/type/impl/UAbstDate.java
|
package com.github.fevernova.io.data.type.impl;
import com.github.fevernova.io.data.type.MethodType;
import com.github.fevernova.io.data.type.UData;
import com.github.fevernova.io.data.type.fromto.UAbstFrom;
import com.github.fevernova.io.data.type.fromto.UAbstTo;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public abstract class UAbstDate extends UData<Date> {
private final SimpleDateFormat format;
public UAbstDate(boolean lazy) {
super(lazy);
this.format = new SimpleDateFormat(getFormatString());
configure(new UAbstFrom<Date>(MethodType.DATE) {
@Override
public void from(final Boolean p) {
unsupport();
}
@Override
public void from(final Integer p) {
super.data = new Date(p * 1000L);
}
@Override
public void from(final Long p) {
super.data = new Date(p);
}
@Override
public void from(final Float p) {
super.data = new Date(p.longValue() * 1000L);
}
@Override
public void from(final Double p) {
super.data = new Date(p.longValue());
}
@Override
public void from(final String p) {
try {
super.data = format.parse(p);
} catch (ParseException e) {
unsupport();
}
}
@Override
public void from(Date p) {
super.data = p;
}
@Override public void from(byte[] p) {
from((Long) MethodType.LONG.parseFromBytes(p));
}
}, new UAbstTo<Date>(MethodType.DATE) {
@Override
public Boolean toBoolean() {
unsupport();
return null;
}
@Override
public Integer toInt() {
return (int) (getFromData().getTime() / 1000L);
}
@Override
public Long toLong() {
return getFromData().getTime();
}
@Override
public Float toFloat() {
return Float.valueOf(getFromData().getTime() / 1000L);
}
@Override
public Double toDouble() {
return Double.valueOf(getFromData().getTime());
}
@Override
public String toStr() {
return format.format(getFromData());
}
@Override
public Date toDate() {
return getFromData();
}
@Override public byte[] toBytes() {
return MethodType.LONG.convertToBytes(toLong());
}
});
}
protected abstract String getFormatString();
}
|
cavidano/natura11y-documentation
|
src/prismjs/plugins/unescaped-markup/prism-unescaped-markup.min.js
|
"undefined" != typeof Prism &&
"undefined" != typeof document &&
(Element.prototype.matches ||
(Element.prototype.matches =
Element.prototype.msMatchesSelector ||
Element.prototype.webkitMatchesSelector),
(Prism.plugins.UnescapedMarkup = !0),
Prism.hooks.add("before-highlightall", function (e) {
e.selector +=
', [class*="lang-"] script[type="text/plain"], [class*="language-"] script[type="text/plain"], script[type="text/plain"][class*="lang-"], script[type="text/plain"][class*="language-"]'
}),
Prism.hooks.add("before-sanity-check", function (e) {
var t = e.element
if (t.matches('script[type="text/plain"]')) {
var a = document.createElement("code"),
c = document.createElement("pre")
c.className = a.className = t.className
var n = t.dataset
return (
Object.keys(n || {}).forEach(function (e) {
Object.prototype.hasOwnProperty.call(n, e) &&
(c.dataset[e] = n[e])
}),
(a.textContent = e.code =
e.code.replace(/<\/script(?:>|>)/gi, "</script>")),
c.appendChild(a),
t.parentNode.replaceChild(c, t),
void (e.element = a)
)
}
if (!e.code) {
var o = t.childNodes
1 === o.length &&
"#comment" == o[0].nodeName &&
(t.textContent = e.code = o[0].textContent)
}
}))
|
cartola-erp/domain-java
|
cartola-domain/src/main/java/net/cartola/domain/PerfilTipo.java
|
package net.cartola.domain;
/**
* 12/04/2016 17:12:05
* @author murilo
*/
public enum PerfilTipo {
CLIENTE,
MAGICO,
VENDAS
}
|
vusion/vusion-api
|
out/test/cases/VueFile/transformDecomposed.spec.js
|
<reponame>vusion/vusion-api
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const VueFile_1 = __importDefault(require("../../../fs/VueFile"));
const chai_1 = require("chai");
const path = __importStar(require("path"));
const shell = __importStar(require("shelljs"));
const fs = __importStar(require("fs-extra"));
const BASE_PATH = path.resolve(__dirname, '../../../../', 'src/test/cases/VueFile/files');
describe('transformDecomposed', () => {
it('should transform decomposed correctly', () => __awaiter(void 0, void 0, void 0, function* () {
const composedPath = path.resolve(BASE_PATH, 'composed/u-composed.vue');
const decomposedPath = path.resolve(BASE_PATH, 'composed/u-decomposed.vue');
const testPath = path.resolve(BASE_PATH, 'composed/u-test.vue');
shell.rm('-rf', testPath);
shell.cp('-r', decomposedPath, testPath);
const vueFile = new VueFile_1.default(testPath);
yield vueFile.open();
yield Promise.all(vueFile.children.map((child) => __awaiter(void 0, void 0, void 0, function* () {
yield child.open();
if (child.isDirectory && !child.isComposed) {
child.transformExportStyle();
const checkResult = child.checkTransform();
if (checkResult !== true) {
return console.warn(child.fullPath, checkResult);
}
else {
child.transform();
}
}
yield child.save();
})));
vueFile.transformDecomposed();
yield vueFile.save();
const files = fs.readdirSync(testPath);
chai_1.expect(files.join(',')).to.equal(fs.readdirSync(composedPath).join(','));
files.forEach((file) => {
const sourcePath = path.resolve(testPath, file);
if (fs.statSync(sourcePath).isDirectory())
return;
chai_1.expect(fs.readFileSync(sourcePath, 'utf8')).to
.equal(fs.readFileSync(path.resolve(composedPath, file), 'utf8'));
});
}));
});
//# sourceMappingURL=transformDecomposed.spec.js.map
|
glatteis/tacas21-artifact
|
artifact/storm/src/storm-parsers/parser/SparseItemLabelingParser.h
|
#pragma once
#include <string>
#include <cstdint>
#include <boost/optional.hpp>
#include "storm-parsers/parser/MappedFile.h"
#include "storm/models/sparse/StateLabeling.h"
#include "storm/models/sparse/ChoiceLabeling.h"
namespace storm {
namespace parser {
/*!
* This class can be used to parse a labeling file.
*/
class SparseItemLabelingParser {
public:
/*!
* Parses the given file and returns the resulting state labeling.
*
* @param stateCount The number of states of the model to be labeled.
* @param filename The path and name of the labeling (.lab) file.
* @return The parsed labeling as a StateLabeling object.
*/
static storm::models::sparse::StateLabeling parseAtomicPropositionLabeling(uint_fast64_t stateCount, std::string const &filename);
/*!
* Parses the given file and returns the resulting choice labeling.
*
* @param choiceCount the number of choices of the model.
* @param filename The name of the file to parse.
* @param nondeterministicChoiceIndices if given, the choices are assumed to be nondeterministic, i.e.,
* a choice is specified by a tuple of state index and (local) choice index.
* @return The resulting choice labeling.
*/
static storm::models::sparse::ChoiceLabeling parseChoiceLabeling(uint_fast64_t choiceCount, std::string const& filename, boost::optional<std::vector<uint_fast64_t>> const& nondeterministicChoiceIndices = boost::none);
private:
/*!
* Perform syntax checks of the file
* @param file The mapped file
*/
static void checkSyntax(std::string const & filename, storm::parser::MappedFile const& file);
/*!
* Parses the file header (i.e. the #DECLARATION ... #END construct) and adds the label names to the given labeling
*
* @param labeling the labeling to which label names are added
* @param buf the reference to the file contents
*/
static void parseLabelNames(std::string const & filename, storm::models::sparse::ItemLabeling& labeling, char const*& buf);
/*!
* Parses the label assignments assuming that each item is uniquely specified by a single index, e.g.,
* * 42 label1 label2 label3
*
* @param labeling the labeling to which file assignments are added
* @param buf the reference to the file contents
*/
static void parseDeterministicLabelAssignments(std::string const & filename, storm::models::sparse::ItemLabeling& labeling, char const*& buf);
/*!
* Parses the label assignments assuming that each item is specified by a tuple of indices, e.g.,
* * 42 0 label1 label2
* * 42 1 label2 label3
*
* @param labeling the labeling to which file assignments are added
* @param nondeterministicChoiceIndices The indices at which the choices of the states begin.
* @param buf the reference to the file contents
*/
static void parseNonDeterministicLabelAssignments(std::string const & filename, storm::models::sparse::ChoiceLabeling& labeling, std::vector<uint_fast64_t> const& nondeterministicChoiceIndices, char const*& buf);
};
} // namespace parser
} // namespace storm
|
541660139/qjtv
|
app/src/main/java/com/lwd/qjtv/mvp/ui/callback/WatchRecordeCallback.java
|
package com.lwd.qjtv.mvp.ui.callback;
/**
* Email:<EMAIL>
* Created by ZhengQian on 2017/5/17.
*/
public interface WatchRecordeCallback {
void clickCallback();
}
|
stephaniestroka/digitalid-core
|
cache/src/main/java/net/digitalid/core/cache/CacheModule.java
|
<filename>cache/src/main/java/net/digitalid/core/cache/CacheModule.java
/*
* Copyright (C) 2017 Synacts GmbH, Switzerland (<EMAIL>)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.digitalid.core.cache;
import java.io.InputStream;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.digitalid.utility.annotations.method.Impure;
import net.digitalid.utility.annotations.method.Pure;
import net.digitalid.utility.annotations.method.PureWithSideEffects;
import net.digitalid.utility.collaboration.annotations.TODO;
import net.digitalid.utility.collaboration.enumerations.Author;
import net.digitalid.utility.configuration.Configuration;
import net.digitalid.utility.contracts.Require;
import net.digitalid.utility.conversion.exceptions.ConversionException;
import net.digitalid.utility.conversion.exceptions.RecoveryException;
import net.digitalid.utility.conversion.exceptions.RecoveryExceptionBuilder;
import net.digitalid.utility.file.Files;
import net.digitalid.utility.immutable.ImmutableList;
import net.digitalid.utility.initialization.annotations.Initialize;
import net.digitalid.utility.logging.Log;
import net.digitalid.utility.string.Strings;
import net.digitalid.utility.time.Time;
import net.digitalid.utility.time.TimeBuilder;
import net.digitalid.utility.tuples.Pair;
import net.digitalid.utility.validation.annotations.math.NonNegative;
import net.digitalid.utility.validation.annotations.type.Utility;
import net.digitalid.database.annotations.transaction.Committing;
import net.digitalid.database.annotations.transaction.NonCommitting;
import net.digitalid.database.conversion.SQL;
import net.digitalid.database.dialect.expression.bool.SQLBooleanExpression;
import net.digitalid.database.dialect.expression.number.SQLLongLiteralBuilder;
import net.digitalid.database.dialect.identifier.column.SQLColumnName;
import net.digitalid.database.dialect.identifier.column.SQLColumnNameBuilder;
import net.digitalid.database.dialect.identifier.schema.SQLSchemaName;
import net.digitalid.database.dialect.identifier.schema.SQLSchemaNameBuilder;
import net.digitalid.database.dialect.identifier.table.SQLExplicitlyQualifiedTableBuilder;
import net.digitalid.database.dialect.identifier.table.SQLQualifiedTable;
import net.digitalid.database.dialect.identifier.table.SQLTableName;
import net.digitalid.database.dialect.identifier.table.SQLTableNameBuilder;
import net.digitalid.database.dialect.statement.select.unordered.simple.SQLSimpleSelectStatement;
import net.digitalid.database.dialect.statement.select.unordered.simple.SQLSimpleSelectStatementBuilder;
import net.digitalid.database.dialect.statement.select.unordered.simple.columns.SQLResultColumn;
import net.digitalid.database.dialect.statement.select.unordered.simple.columns.SQLResultColumnBuilder;
import net.digitalid.database.dialect.statement.select.unordered.simple.sources.SQLTableSource;
import net.digitalid.database.dialect.statement.select.unordered.simple.sources.SQLTableSourceBuilder;
import net.digitalid.database.dialect.statement.update.SQLAssignment;
import net.digitalid.database.dialect.statement.update.SQLAssignmentBuilder;
import net.digitalid.database.dialect.statement.update.SQLUpdateStatement;
import net.digitalid.database.dialect.statement.update.SQLUpdateStatementBuilder;
import net.digitalid.database.exceptions.DatabaseException;
import net.digitalid.database.interfaces.Database;
import net.digitalid.database.interfaces.SQLDecoder;
import net.digitalid.database.interfaces.encoder.SQLActionEncoder;
import net.digitalid.database.interfaces.encoder.SQLQueryEncoder;
import net.digitalid.core.asymmetrickey.PrivateKeyRetriever;
import net.digitalid.core.attribute.AttributePropertiesLoader;
import net.digitalid.core.client.ClientSecretLoader;
import net.digitalid.core.client.role.Role;
import net.digitalid.core.client.role.RoleModule;
import net.digitalid.core.entity.factories.AccountFactory;
import net.digitalid.core.handler.reply.Reply;
import net.digitalid.core.host.Host;
import net.digitalid.core.host.HostBuilder;
import net.digitalid.core.host.key.PrivateKeyChainLoader;
import net.digitalid.core.host.key.PublicKeyChainLoader;
import net.digitalid.core.identification.annotations.AttributeType;
import net.digitalid.core.identification.identifier.HostIdentifier;
import net.digitalid.core.identification.identity.HostIdentity;
import net.digitalid.core.identification.identity.InternalIdentity;
import net.digitalid.core.identification.identity.InternalNonHostIdentity;
import net.digitalid.core.identification.identity.SemanticType;
import net.digitalid.core.identification.identity.SemanticTypeAttributesBuilder;
import net.digitalid.core.identification.identity.SyntacticType;
import net.digitalid.core.keychain.PublicKeyChain;
import net.digitalid.core.pack.Pack;
import net.digitalid.core.pack.PackConverter;
import net.digitalid.core.signature.attribute.AttributeValue;
import net.digitalid.core.signature.attribute.AttributeValueConverter;
import net.digitalid.core.signature.attribute.CertifiedAttributeValue;
import net.digitalid.core.signature.attribute.CertifiedAttributeValueConverter;
import net.digitalid.core.signature.host.HostSignature;
import net.digitalid.core.signature.host.HostSignatureCreator;
import net.digitalid.core.unit.GeneralUnit;
/**
* This class provides database access to the {@link Cache cache}.
*/
@Utility
public abstract class CacheModule {
/* -------------------------------------------------- Configuration -------------------------------------------------- */
/**
* Stores a dummy configuration in order to have an initialization target for table creation.
*/
public static final @Nonnull Configuration<Boolean> configuration = Configuration.with(Boolean.TRUE);
/* -------------------------------------------------- Creation -------------------------------------------------- */
/**
* Creates the database table.
*/
@Committing
@PureWithSideEffects
@Initialize(target = CacheModule.class, dependencies = RoleModule.class)
public static void createTable() throws DatabaseException {
SQL.createTable(CacheEntryConverter.INSTANCE, GeneralUnit.INSTANCE);
}
/* -------------------------------------------------- Root Key -------------------------------------------------- */
/**
* Initializes the cache with the public key of {@code core.digitalid.net}.
*/
@Committing
@PureWithSideEffects
@TODO(task = "Provide the correct parameters for the loading of the type.", date = "2017-10-05", author = Author.KASPAR_ETTER)
@Initialize(target = CacheModule.class, dependencies = {AccountFactory.class, AttributePropertiesLoader.class, PrivateKeyRetriever.class, PrivateKeyChainLoader.class, PublicKeyChainLoader.class, ClientSecretLoader.class})
public static void initializeRootKey() throws ConversionException {
if (!getCachedAttributeValue(null, HostIdentity.DIGITALID, Time.MIN, PublicKeyChain.TYPE).get0()) {
// Unless it is the root server, the program should have been delivered with the public key chain of 'core.digitalid.net'.
final @Nullable InputStream inputStream = Cache.class.getResourceAsStream("/net/digitalid/core/cache/core.digitalid.net.certificate.xdf");
final @Nonnull AttributeValue value;
if (inputStream != null) {
final @Nonnull SemanticType semanticType = SemanticType.map(CertifiedAttributeValueConverter.INSTANCE);
semanticType.load(SemanticTypeAttributesBuilder.withSyntacticBase(SyntacticType.BOOLEAN).build());
Database.commit(); // The type mapping has to be committed because the local map is not updated otherwise.
value = Pack.loadFrom(inputStream).unpack(CertifiedAttributeValueConverter.INSTANCE, null);
Log.debugging("The public key chain of the root host $ was loaded from the provided resources.", HostIdentifier.DIGITALID);
} else {
// Since the public key chain of 'core.digitalid.net' is not available, the host 'core.digitalid.net' is created on this server.
Log.warning("The public key chain of the root host $ was not found in the provided resources.", HostIdentifier.DIGITALID);
Log.information("Creating the host $, which can take several minutes.", HostIdentifier.DIGITALID);
final @Nonnull Host host = HostBuilder.withIdentifier(HostIdentifier.DIGITALID).build();
final @Nonnull HostSignature<Pack> hostSignature = HostSignatureCreator.sign(host.publicKeyChain.get().pack(), PackConverter.INSTANCE).about(HostIdentifier.DIGITALID).as(PublicKeyChain.TYPE.getAddress());
value = CertifiedAttributeValue.with(hostSignature);
value.pack().storeTo(Files.relativeToConfigurationDirectory("core.digitalid.net.certificate.xdf"));
}
setCachedAttributeValue(null, HostIdentity.DIGITALID, Time.MIN, PublicKeyChain.TYPE, value, null);
}
Database.commit();
}
/* -------------------------------------------------- Dialect Constants -------------------------------------------------- */
private static final @Nonnull SQLTableName tableName = SQLTableNameBuilder.withString(CacheEntryConverter.INSTANCE.getTypeName()).build();
private static final @Nonnull SQLSchemaName schemaName = SQLSchemaNameBuilder.withString(GeneralUnit.INSTANCE.getName()).build();
private static final @Nonnull SQLQualifiedTable qualifiedTable = SQLExplicitlyQualifiedTableBuilder.withTable(tableName).withSchema(schemaName).build();
/* -------------------------------------------------- Cache Invalidation -------------------------------------------------- */
/**
* Invalidates all the cached attribute values of the given identity.
*/
@NonCommitting
@PureWithSideEffects
public static void invalidateCachedAttributeValues(@Nonnull InternalNonHostIdentity identity) throws DatabaseException {
final @Nonnull Time currentTime = TimeBuilder.build();
final @Nonnull SQLAssignment assignment = SQLAssignmentBuilder.withColumn(SQLColumnNameBuilder.withString("expirationtime_value").build()).withExpression(SQLLongLiteralBuilder.withValue(currentTime.getValue()).build()).build();
@Nonnull SQLBooleanExpression whereClause = SQLColumnNameBuilder.withString("requestee_key").build().equal(SQLLongLiteralBuilder.withValue(identity.getKey()).build()); // TODO: Implement it in such a way that the representation of the internal identity can change.
whereClause = whereClause.and(SQLColumnNameBuilder.withString("expirationtime_value").build().greater(SQLLongLiteralBuilder.withValue(currentTime.getValue()).build())); // TODO: Implement it in such a way that the representation of the time can change?
final @Nonnull SQLUpdateStatement updateStatement = SQLUpdateStatementBuilder.withTable(qualifiedTable).withAssignments(ImmutableList.withElements(assignment)).withWhereClause(whereClause).build();
final @Nonnull SQLActionEncoder actionEncoder = Database.instance.get().getEncoder(updateStatement, GeneralUnit.INSTANCE);
actionEncoder.execute();
}
/* -------------------------------------------------- Cache Reading -------------------------------------------------- */
/**
* Returns the cached attribute value with the given type of the given requestee as queried by the given requester.
*
* @param requester the role that queries the attribute value or null for hosts (respectively an anonymous query for public attributes).
* @param requestee the identity whose cached attribute value is to be returned.
* @param expiration the time at which the cached attribute value has to be fresh.
* @param type the type of the attribute value which is to be returned.
*
* @return a pair of a boolean indicating whether the attribute value of the given type is cached and the value being cached or null if it is not available (which allows to cache non-availability).
*
* @require type.isAttributeFor(requestee.getCategory()) : "The type can be used as an attribute for the category of the given requestee.";
*
* @ensure return.getValue1() == null || return.getValue1().getContent().getType().equals(type) : "The content of the returned attribute value is null or matches the given type.";
*/
@Pure
@NonCommitting
static @Nonnull Pair<@Nonnull Boolean, @Nullable AttributeValue> getCachedAttributeValue(@Nullable Role requester, @Nonnull InternalIdentity requestee, @Nonnull @NonNegative Time expiration, @Nonnull @AttributeType SemanticType type) throws DatabaseException, RecoveryException {
Require.that(expiration.isNonNegative()).orThrow("The given time has to be non-negative but was $.", expiration);
Require.that(type.isAttributeFor(requestee.getCategory())).orThrow("The type $ cannot be used as an attribute for the category $ of the given identity $.", type, requestee.getCategory(), requestee);
if (expiration.equals(Time.MAX)) { return Pair.of(false, null); }
final @Nonnull SQLResultColumn foundColumn = SQLResultColumnBuilder.withExpression(SQLColumnNameBuilder.withString("found").build()).build();
final @Nonnull SQLResultColumn attributeValueColumn1 = SQLResultColumnBuilder.withExpression(SQLColumnNameBuilder.withString("attributevalue_type_key").build()).build();
final @Nonnull SQLResultColumn attributeValueColumn2 = SQLResultColumnBuilder.withExpression(SQLColumnNameBuilder.withString("attributevalue_bytes").build()).build();
final @Nonnull ImmutableList<@Nonnull SQLResultColumn> resultColumns = ImmutableList.withElements(foundColumn, attributeValueColumn1, attributeValueColumn2);
final @Nonnull ImmutableList<@Nonnull SQLTableSource> sources = ImmutableList.withElements(SQLTableSourceBuilder.withSource(qualifiedTable).build());
final @Nonnull SQLColumnName requesterColumnName = SQLColumnNameBuilder.withString("requester").build();
@Nonnull SQLBooleanExpression whereClause = requesterColumnName.equal(SQLLongLiteralBuilder.withValue(0).build());
if (requester != null) { whereClause = whereClause.or(requesterColumnName.equal(SQLLongLiteralBuilder.withValue(requester.getKey()).build())); }
whereClause = whereClause.and(SQLColumnNameBuilder.withString("requestee_key").build().equal(SQLLongLiteralBuilder.withValue(requestee.getKey()).build())); // TODO: Implement it in such a way that the representation of the internal identity can change.
whereClause = whereClause.and(SQLColumnNameBuilder.withString("attributetype_key").build().equal(SQLLongLiteralBuilder.withValue(type.getKey()).build())); // TODO: Implement it in such a way that the representation of the semantic type can change.
whereClause = whereClause.and(SQLColumnNameBuilder.withString("expirationtime_value").build().greaterOrEqual(SQLLongLiteralBuilder.withValue(expiration.getValue()).build())); // TODO: Implement it in such a way that the representation of the time can change?
final @Nonnull SQLSimpleSelectStatement selectStatement = SQLSimpleSelectStatementBuilder.withColumns(resultColumns).withSources(sources).withWhereClause(whereClause).build();
final @Nonnull SQLQueryEncoder queryEncoder = Database.instance.get().getEncoder(selectStatement, GeneralUnit.INSTANCE);
final @Nonnull SQLDecoder decoder = queryEncoder.execute();
boolean found = false;
@Nullable AttributeValue value = null;
if (decoder.moveToNextRow()) {
found = true;
do {
if (decoder.decodeBoolean()) {
final @Nonnull Pack pack = PackConverter.INSTANCE.recover(decoder, null);
value = pack.unpack(AttributeValueConverter.INSTANCE, null);
final @Nonnull SemanticType recoveredType = value.getContent().getType();
if (!recoveredType.equals(type)) { throw RecoveryExceptionBuilder.withMessage(Strings.format("The recovered attribute value with the type $ does not match the queried type $.", recoveredType, type)).build(); }
break;
}
} while (decoder.moveToNextRow());
}
return Pair.of(found, value);
}
/* -------------------------------------------------- Cache Writing -------------------------------------------------- */
/**
* Sets the cached attribute value with the given type for the given requestee.
*
* @param requester the role that queried the attribute value or null for public.
* @param requestee the identity whose cached attribute value is to be set.
* @param expiration the time at which the cached attribute value will expire.
* @param type the type of the attribute value which is to be set.
* @param value the cached attribute value which is to be set.
* @param reply the reply that returned the given attribute value.
*
* @require type.isAttributeFor(requestee.getCategory()) : "The type can be used as an attribute for the category of the given requestee.";
* @require value == null || value.isVerified() : "The attribute value is null or its signature is verified.";
* @require value == null || value.getContent().getType().equals(type) : "The content of the given attribute value is null or matches the given type.";
*/
@Impure
@NonCommitting
static void setCachedAttributeValue(@Nullable Role requester, @Nonnull InternalIdentity requestee, @Nonnull @NonNegative Time expiration, @Nonnull SemanticType type, @Nullable AttributeValue value, @Nullable Reply<?> reply) throws DatabaseException {
Require.that(expiration.isNonNegative()).orThrow("The given time has to be non-negative but was $.");
Require.that(type.isAttributeFor(requestee.getCategory())).orThrow("The type $ cannot be used as an attribute for the category $ of the given identity $.", type, requestee.getCategory(), requestee);
Require.that(value == null || value.isVerified()).orThrow("The attribute value has to be null or its signature has to be verified.");
Require.that(value == null || value.getContent().getType().equals(type)).orThrow("The content of the given attribute value has to be null or match the given type.");
final @Nonnull CacheEntry entry = CacheEntryBuilder.withRequester(requester != null ? requester.getKey() : 0).withRequestee(requestee).withAttributeType(type).withFound(value != null).withExpirationTime(expiration).withAttributeValue(value != null ? Pack.pack(AttributeValueConverter.INSTANCE, value) : null).build();
SQL.insertOrReplace(CacheEntryConverter.INSTANCE, entry, GeneralUnit.INSTANCE);
}
}
|
toadkicker/railsstrap
|
lib/railsstrap/helpers/alert_box_helper.rb
|
<filename>lib/railsstrap/helpers/alert_box_helper.rb
require 'railsstrap/classes/alert_box'
module Railsstrap
module Helpers
# Displays a Bootstrap-styled alert message.
# @see http://getbootstrap.com/components/docs/4.0/alerts
# @return [String] the HTML to display a Bootstrap-styled alert message.
# @overload alert_box(content, options = {})
# @param [#to_s] content the content to display in the alert.
# @param [Hash] options the options for the alert box. Any option not
# listed below is passed as an HTML attribute to the alertโs `<div>`.
# @option options [Boolean] :dismissible (false) whether to display an
# 'ร' to the right of the box that can be clicked to dismiss the alert.
# @option options [#to_s] :variant (:info) the variant alternative to
# apply to the alert. Can be `:danger`, `:info`, `:success` or
# `:warning`.
# @option options [#to_s] :priority if set to one of the priority levels
# of Rails flash contents, determines the variant of the alert box.
# Can be :alert or :notice.
# @example Display a dismissible alert box with a plain-text content.
# alert_box 'User updated successfully', dismissible: true
# @overload alert_box(options = {}, &block)
# @param [Hash] options the options for the alert box (see above).
# @yieldreturn [#to_s] the content to display in the alert.
# @example Display a success alert box with an HTML content.
# alert_box variant: :success do
# content_tag :strong, 'User updated successfully'
# end
def alert_box(*args, &block)
alert_box = Railsstrap::AlertBox.new(self, *args, &block)
alert_box.extract! :variant, :priority, :dismissible, :dismiss, :size
alert_box.append_class! :alert
alert_box.append_class! alert_box.size_class
alert_box.append_class! alert_box.variant_class
alert_box.merge! role: :alert
alert_box.prepend_html! alert_box.dismissible_button
alert_box.render_tag :div
end
end
end
|
apache/forrest
|
whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/testing/org/apache/forrest/dispatcher/AbstractStructurer.java
|
<filename>whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/testing/org/apache/forrest/dispatcher/AbstractStructurer.java
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.forrest.dispatcher;
import java.io.InputStream;
import java.util.HashMap;
import javax.xml.transform.ErrorListener;
import javax.xml.transform.TransformerFactory;
import junit.framework.TestCase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.forrest.dispatcher.api.Structurer;
import org.apache.forrest.dispatcher.config.WritableDispatcherBean;
import org.apache.forrest.dispatcher.impl.ClassPathResolver;
import org.apache.forrest.dispatcher.impl.helper.LoggingErrorListener;
import org.apache.forrest.dispatcher.impl.helper.StAX;
public abstract class AbstractStructurer extends TestCase {
protected final Log log = LogFactory.getLog(this.getClass()
.getCanonicalName());
protected HashMap<String, Object> properties;
protected WritableDispatcherBean config;
public AbstractStructurer() {
super();
}
public AbstractStructurer(String name) {
super(name);
}
protected void prepareStructurer(boolean allowXml){
TransformerFactory transFact = TransformerFactory.newInstance();
ErrorListener listener = new LoggingErrorListener(log);
transFact.setErrorListener(listener);
config = new WritableDispatcherBean();
config.setTransFact(transFact);
config.setStaxHelper(new StAX());
config.setAllowXmlProperties(allowXml);
config.setResolver(new ClassPathResolver());
config.setContractUriPrefix("/org/apache/forrest/dispatcher/");
properties = new HashMap<String, Object>();
}
protected abstract Structurer getStructurer(boolean allowXml);
protected InputStream getStream() {
InputStream dataStream = this.getClass()
.getResourceAsStream(getUrl());
return dataStream;
}
public abstract String getUrl();
}
|
parthagar/TTN-Exercises
|
Java Exercises/Day 2/12.java
|
<filename>Java Exercises/Day 2/12.java<gh_stars>0
class Parent extends Grandparent {
{
System.out.println("instance - parent");
}
public Parent() {
System.out.println("constructor - parent");
}
static {
System.out.println("static - parent");
}
}
class Grandparent {
static {
System.out.println("static - grandparent");
}
{
System.out.println("instance - grandparent");
}
public Grandparent() {
System.out.println("constructor - grandparent");
}
}
class Child extends Parent {
public Child() {
System.out.println("constructor - child");
}
static {
System.out.println("static - child");
}
{
System.out.println("instance - child");
}
}
class Exercise_2_12{
public static void main(String[] args) {
Child c = new Child();
}
}
|
tqrg-bot/orientdb
|
core/src/test/java/com/orientechnologies/orient/core/sql/OOQueryOperatorTest.java
|
<reponame>tqrg-bot/orientdb
package com.orientechnologies.orient.core.sql;
import com.orientechnologies.orient.core.sql.operator.OQueryOperator;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorAnd;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorBetween;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorContains;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorContainsAll;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorContainsKey;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorContainsText;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorContainsValue;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorEquals;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorIn;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorInstanceof;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorIs;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorLike;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorMajor;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorMajorEquals;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorMatches;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorMinor;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorMinorEquals;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorNot;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorNotEquals;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorOr;
import com.orientechnologies.orient.core.sql.operator.OQueryOperatorTraverse;
import com.orientechnologies.orient.core.sql.operator.math.OQueryOperatorDivide;
import com.orientechnologies.orient.core.sql.operator.math.OQueryOperatorMinus;
import com.orientechnologies.orient.core.sql.operator.math.OQueryOperatorMod;
import com.orientechnologies.orient.core.sql.operator.math.OQueryOperatorMultiply;
import com.orientechnologies.orient.core.sql.operator.math.OQueryOperatorPlus;
import org.junit.Assert; import org.junit.Test;
public class OOQueryOperatorTest {
@Test
public void testOperatorOrder() {
//check operator are the correct order
final OQueryOperator[] operators = OSQLEngine.INSTANCE.getRecordOperators();
int i=0;
Assert.assertTrue(operators[i++] instanceof OQueryOperatorEquals);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorAnd);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorOr);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorNotEquals);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorNot);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorMinorEquals);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorMinor);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorMajorEquals);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorContainsAll);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorMajor);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorLike);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorMatches);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorInstanceof);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorIs);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorIn);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorContainsKey);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorContainsValue);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorContainsText);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorContains);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorTraverse);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorBetween);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorPlus);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorMinus);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorMultiply);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorDivide);
Assert.assertTrue(operators[i++] instanceof OQueryOperatorMod);
}
}
|
marcinz/legate.pandas
|
tests/pandas/df_merge_index.py
|
# Copyright 2021 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import itertools
import numpy as np
import pandas as pd
from numpy.random import randn
from legate import pandas as lp
key_dtypes = [np.int32, np.int64]
# XXX: Pandas is really weird in its handling of join keys. Specifically,
# if the index of the left table is UIntXXIndex or FloatXXIndex and
# it is used for the join, Pandas will always convert it into
# Int64Index, even though there is no valid reason for doing that.
# In Legate, we will not do this type conversion, as it's really
# bad for performance, given that the index can be stored across
# all the nodes in the system.
# key_dtypes += [np.uint32, np.uint64, np.float32, np.float64]
def to_pandas(ldf):
columns = {}
for column in ldf.columns:
columns[column] = ldf[column].to_numpy()
return pd.DataFrame(columns)
def sort_and_compare(df1, df2):
df1 = df1.sort_values(by=df1.columns.to_list(), ignore_index=True)
df2 = df2.sort_values(by=df1.columns.to_list(), ignore_index=True)
return df1.equals(df2)
for n in [15, 30, 45]:
c1 = np.array(randn(n) * 100.0, dtype=np.int64)
c2 = np.array(randn(n // 3) * 100.0, dtype=np.int64)
c3_l = np.array(randn(n) * 100.0, dtype=np.int64)
c3_r = np.array(randn(n // 3) * 100.0, dtype=np.int64)
key_right = list(range(n // 3))
key_left = list(itertools.chain(*[[x] * 3 for x in range(n // 3)]))
for key_dtype in key_dtypes:
print("Type: inner, Size: %u, Key dtype: %s" % (n, str(key_dtype)))
df1 = pd.DataFrame(
{"c1": c1, "key1": np.array(key_left, dtype=key_dtype), "c3": c3_l}
)
df1["key"] = df1["key1"]
df1_key_on_index = df1.set_index("key")
df2 = pd.DataFrame(
{
"c2": c2,
"key2": np.array(key_right, dtype=key_dtype),
"c3": c3_r,
}
)
df2["key"] = df2["key2"]
df2_key_on_index = df2.set_index("key")
ldf1 = lp.DataFrame(df1)
ldf1_key_on_index = lp.DataFrame(df1_key_on_index)
ldf2 = lp.DataFrame(df2)
ldf2_key_on_index = lp.DataFrame(df2_key_on_index)
join_pandas2 = df1.merge(
df2_key_on_index, left_on="key1", right_index=True
)
join_pandas4 = df1_key_on_index.merge(
df2, right_on="key2", left_index=True
)
# XXX: Pandas sort the keys in the output when both left_index and
# right_index are True, whereas Legate will not for performance
# reasons. In this test we sorted the keys in the input dataframe
# so that Pandas' join output coincides with Legate's. We can't
# and won't guarantee this semantics equivalence in general.
join_pandas5 = df1_key_on_index.merge(
df2_key_on_index, left_index=True, right_index=True
)
join_pandas6 = df1.merge(df2, left_on="key1", right_on="key2")
join_legate2 = ldf1.merge(
ldf2_key_on_index,
left_on="key1",
right_index=True,
method="broadcast",
)
assert sort_and_compare(join_pandas2, to_pandas(join_legate2))
join_legate4 = ldf1_key_on_index.merge(
ldf2, right_on="key2", left_index=True, method="broadcast"
)
assert sort_and_compare(join_pandas4, to_pandas(join_legate4))
join_legate5 = ldf1_key_on_index.merge(
ldf2_key_on_index,
left_index=True,
right_index=True,
method="broadcast",
)
assert sort_and_compare(join_pandas5, to_pandas(join_legate5))
join_legate6 = ldf1.merge(
ldf2, left_on="key1", right_on="key2", method="broadcast"
)
assert sort_and_compare(join_pandas6, to_pandas(join_legate6))
join_legate_hash2 = ldf1.merge(
ldf2_key_on_index, left_on="key1", right_index=True, method="hash"
)
assert sort_and_compare(join_pandas2, to_pandas(join_legate_hash2))
join_legate_hash4 = ldf1_key_on_index.merge(
ldf2, right_on="key2", left_index=True, method="hash"
)
assert sort_and_compare(join_pandas4, to_pandas(join_legate_hash4))
join_legate_hash5 = ldf1_key_on_index.merge(
ldf2_key_on_index, left_index=True, right_index=True, method="hash"
)
assert sort_and_compare(join_pandas5, to_pandas(join_legate_hash5))
join_legate_hash6 = ldf1.merge(
ldf2, left_on="key1", right_on="key2", method="hash"
)
assert sort_and_compare(join_pandas6, to_pandas(join_legate_hash6))
|
leandrochomp/react-skeleton
|
node_modules/watchify/node_modules/browserify/node_modules/labeled-stream-splicer/node_modules/stream-splicer/example/header.js
|
<gh_stars>1000+
var splicer = require('../');
var through = require('through2');
var JSONStream = require('JSONStream');
var split = require('split');
var headerData = {};
var headers = through.obj(function (buf, enc, next) {
var line = buf.toString('utf8');
if (line === '') {
this.push(headerData);
pipeline.splice(1, 1, JSONStream.parse([ 'rows', true ]));
}
else {
var m = /^(\S+):(.+)/.exec(line);
var key = m && m[1].trim();
var value = m && m[2].trim();
if (m) headerData[key] = value;
}
next();
});
var pipeline = splicer([ split(), headers, JSONStream.stringify() ]);
process.stdin.pipe(pipeline).pipe(process.stdout);
|
himanshiLt/prepack
|
test/serializer/optimized-functions/DefineOptFuncInsideFuncInsideOptFunc.js
|
<reponame>himanshiLt/prepack
// arrayNestedOptimizedFunctionsEnabled
// skip lint
// The original issue here was that nested is defined inside of fn2 which is a non-optimized function
// called by fn (an optimized function). That caused Prepack to not detect that nested was nested
// in optimize.
function fn2(props) {
var _ref11;
var commentsConnection =
(_ref11 = props) != null ? ((_ref11 = _ref11.feedback) != null ? _ref11.display_comments : _ref11) : _ref11;
var func = props.func;
var nested = function() {
return func(commentsConnection);
};
if (global.__optimize) __optimize(nested);
return props.items.map(nested);
}
function fn(props) {
var items = Array.from(props.items);
var func = function(commentsConnection) {
return commentsConnection;
};
return fn2({
items: items,
func: func,
feedback: props.feedback,
});
}
inspect = function() {
return JSON.stringify(fn({ items: [0, 1, 2], feedback: { display_comments: [1, 2, 3] } }));
};
if (global.__optimize) __optimize(fn);
|
pledac/trust-code
|
src/ThHyd/Quasi_Compressible/VDF/EDO_Pression_th_VDF.cpp
|
/****************************************************************************
* Copyright (c) 2020, CEA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
//////////////////////////////////////////////////////////////////////////////
//
// File: EDO_Pression_th_VDF.cpp
// Directory: $TRUST_ROOT/src/ThHyd/Quasi_Compressible/VDF
// Version: /main/28
//
//////////////////////////////////////////////////////////////////////////////
#include <EDO_Pression_th_VDF.h>
#include <Zone_VDF.h>
#include <Zone_Cl_VDF.h>
#include <Sortie_libre_pression_imposee_QC.h>
#include <Debog.h>
#include <Convection_Diffusion_Temperature.h>
#include <Champ_Face.h>
#include <Loi_Etat_Melange_GP.h>
#include <Check_espace_virtuel.h>
#include <communications.h>
Implemente_base(EDO_Pression_th_VDF,"EDO_Pression_th_VDF",EDO_Pression_th_base);
Sortie& EDO_Pression_th_VDF::printOn(Sortie& os) const
{
return EDO_Pression_th_base::printOn(os);
}
Entree& EDO_Pression_th_VDF::readOn(Entree& is)
{
return EDO_Pression_th_base::readOn(is);
}
void EDO_Pression_th_VDF::associer_zones(const Zone_dis& zone, const Zone_Cl_dis& zone_cl)
{
la_zone = ref_cast(Zone_VDF,zone.valeur());
la_zone_Cl = zone_cl;
Champ_Face toto;
toto.associer_zone_dis_base(zone.valeur());
toto.fixer_nb_comp(1);
toto.fixer_nb_valeurs_nodales(la_zone->nb_faces());
//tab_rhoFa=toto.valeurs();
tab_rho_face=toto.valeurs();
tab_rho_face_demi=toto.valeurs();
tab_rho_face_np1=toto.valeurs();
}
// Description:
// Complete l'EDO : calcule rho sur les faces
// Precondition:
// Parametre:
// Signification:
// Valeurs par defaut:
// Contraintes:
// Acces:
// Retour:
// Signification:
// Contraintes:
// Exception:
// Effets de bord:
// Postcondition:
void EDO_Pression_th_VDF::completer()
{
const DoubleTab& tab_ICh = le_fluide_->inco_chaleur().valeurs();
double Pth=le_fluide_->pression_th();
M0=masse_totale(Pth,tab_ICh);
le_fluide_->checkTraitementPth(la_zone_Cl);
}
// Description:
// Calcule la moyenne volumique de la grandeur P0 donnee
// Precondition:
// Parametre:
// Signification:
// Valeurs par defaut:
// Contraintes:
// Acces:
// Retour: DoubleTab&
// Signification: rho discretise par face
// Contraintes:
// Exception:
// Effets de bord:
// Postcondition:
double EDO_Pression_th_VDF::moyenne_vol(const DoubleTab& tab) const
{
int nb_elem=la_zone->nb_elem();
const DoubleVect& volumes = la_zone->volumes();
assert(tab.dimension(0)==nb_elem);
ArrOfDouble sum(2);
sum = 0;
for (int elem=0 ; elem<nb_elem ; elem++)
{
double v = volumes(elem);
sum[0] += v;
sum[1] += v*tab(elem);
}
mp_sum_for_each_item(sum);
return sum[1]/sum[0];
}
void EDO_Pression_th_VDF::calculer_rho_face_np1(const DoubleTab& tab_rhoP0)
{
int face,nb_faces_tot = la_zone->nb_faces_tot();
int elem;
Debog::verifier("tab_rhoP0",tab_rhoP0);
int i, nb_comp;
IntTab& face_voisins = la_zone->face_voisins();
for (face=0 ; face<nb_faces_tot ; face++)
{
nb_comp=0;
tab_rho_face_np1(face) = 0;
for (i=0 ; i<2 ; i++)
{
elem= face_voisins(face,i);
if (elem!=-1)
{
nb_comp++;
tab_rho_face_np1(face) += tab_rhoP0(elem);
}
}
tab_rho_face_np1(face) /= nb_comp;
}
tab_rho_face_np1.echange_espace_virtuel();
Debog::verifier("tab_rho_face_np1",tab_rho_face_np1);
for (face=0 ; face<nb_faces_tot ; face++)
{
tab_rho_face_demi(face)=(tab_rho_face_np1(face)+tab_rho_face(face))/2.;
}
}
// Description:
// Renvoie rho avec la meme discretisation que la vitesse :
// une valeur par face en VDF
// Precondition:
// Parametre:
// Signification:
// Valeurs par defaut:
// Contraintes:
// Acces:
// Retour: DoubleTab&
// Signification: rho discretise par face
// Contraintes:
// Exception:
// Effets de bord:
// Postcondition:
const DoubleTab& EDO_Pression_th_VDF::rho_discvit() const
{
return tab_rho_face_demi;
}
// Description:
// Renvoie div(u) avec la meme discretisation que la vitesse :
// une valeur par face en VDF
// Precondition:
// Parametre:
// Signification:
// Valeurs par defaut:
// Contraintes:
// Acces:
// Retour: DoubleTab&
// Signification: div(u) discretise par face
// Contraintes:
// Exception:
// Effets de bord:
// Postcondition:
void EDO_Pression_th_VDF::divu_discvit(const DoubleTab& secmem1, DoubleTab& secmem2)
{
assert_espace_virtuel_vect(secmem1);
int nb_faces_tot = la_zone->nb_faces_tot();
IntTab& face_voisins = la_zone->face_voisins();
//remplissage de div(u) sur les faces
for (int face=0 ; face<nb_faces_tot; face++)
{
int nb_comp=0;
secmem2(face)=0;
for (int i=0 ; i<2 ; i++)
{
int elem= face_voisins(face,i);
if (elem!=-1)
{
nb_comp++;
secmem2(face) += secmem1(elem);
}
}
secmem2(face) /= nb_comp;
}
secmem2.echange_espace_virtuel();
}
// Description:
// Renvoie la valeur de la pression calculee pour conserver la masse
// Precondition:
// Parametre:
// Signification:
// Valeurs par defaut:
// Contraintes:
// Acces:
// Retour: Double
// Signification: pression calculee
// Contraintes:
// Exception:
// Effets de bord:
// Postcondition:
double EDO_Pression_th_VDF::masse_totale(double P,const DoubleTab& T)
{
int elem, nb_elem=la_zone->nb_elem();
const DoubleVect& volumes = la_zone->volumes();
const Loi_Etat_base& loi_ = ref_cast(Loi_Etat_base,le_fluide_->loi_etat().valeur());
double M=0;
if (!sub_type(Loi_Etat_Melange_GP,loi_))
{
for (elem=0 ; elem<nb_elem ; elem++)
{
double v = volumes(elem);
M += v*loi_.calculer_masse_volumique(P,T[elem]);
}
}
else
{
const Loi_Etat_Melange_GP& loi_mel_GP = ref_cast(Loi_Etat_Melange_GP,loi_);
const DoubleTab& Masse_mol_mel = loi_mel_GP.masse_molaire();
for (elem=0 ; elem<nb_elem ; elem++)
{
double v = volumes(elem);
double r = 8.3143/Masse_mol_mel(elem);
M += v*loi_mel_GP.calculer_masse_volumique_case(P,T[elem],r,elem);
}
}
M=Process::mp_sum(M);
return M;
}
// Description:
// Calcule le second membre de l'equation de continuite :
// div(rhoU) = W = -dZ/dT avec Z=rho
// Precondition:
// Parametre:
// Signification:
// Valeurs par defaut:
// Contraintes:
// Acces:
// Retour: DoubleTab&
// Signification: rho discretise par face
// Contraintes:
// Exception:
// Effets de bord:
// Postcondition:
void EDO_Pression_th_VDF::secmembre_divU_Z(DoubleTab& tab_W) const
{
double dt = le_fluide().vitesse()->equation().schema_temps().pas_de_temps();
int nb_faces = la_zone->nb_faces();
int elem,nb_elem = la_zone->nb_elem();
DoubleVect tab_dZ(nb_elem);
DoubleTab tab_gradZ(nb_faces);
const DoubleTab& tab_rhonP0 = le_fluide().loi_etat()->rho_n();
const DoubleTab& tab_rhonp1P0 = le_fluide().loi_etat()->rho_np1();
Debog::verifier("divU tab_rhonP0",tab_rhonP0);
Debog::verifier("divU tab_rhonp1P0",tab_rhonp1P0);
const DoubleVect& volumes = la_zone->volumes();
for (elem=0 ; elem<nb_elem ; elem++)
{
//Corrections pour eviter l assemblage de la matrice de pression
tab_dZ(elem) = (tab_rhonp1P0(elem)-tab_rhonP0(elem))/dt;
}
double tmp;
for (elem=0 ; elem<nb_elem ; elem++)
{
tmp = tab_dZ(elem) ;
tab_W(elem) = -tmp * volumes(elem);
}
}
void EDO_Pression_th_VDF::calculer_grad(const DoubleTab& inco, DoubleTab& resu)
{
int face, n0, n1, ori;
double coef;
IntTab& face_voisins = la_zone->face_voisins();
IntVect& orientation = la_zone->orientation();
DoubleVect& porosite_surf = la_zone->porosite_face();
DoubleTab& xp = la_zone->xp();
DoubleVect& volume_entrelaces = la_zone->volumes_entrelaces();
// Boucle sur les faces internes
for (face=la_zone->premiere_face_int(); face<la_zone->nb_faces(); face++)
{
n0 = face_voisins(face,0);
n1 = face_voisins(face,1);
ori = orientation(face);
coef = volume_entrelaces(face)*porosite_surf(face);
coef=1;
resu(face) += coef*(inco(n1)-inco(n0))/(xp(n1,ori)- xp(n0,ori));
}
}
void EDO_Pression_th_VDF::mettre_a_jour(double temps)
{
// a voir
// copie de tab_rho_face_np1 dans tab_rho_face
int n=tab_rho_face_np1.size_totale();
for (int i=0; i<n; i++)
{
tab_rho_face(i)=tab_rho_face_np1(i);
tab_rho_face_demi(i)=tab_rho_face_np1(i);
}
}
void EDO_Pression_th_VDF::mettre_a_jour_CL(double P)
{
for (int n_bord=0; n_bord<la_zone->nb_front_Cl(); n_bord++)
{
const Cond_lim& la_cl = la_zone_Cl->les_conditions_limites(n_bord);
if (sub_type(Sortie_libre_pression_imposee_QC, la_cl.valeur()))
{
Sortie_libre_pression_imposee_QC& cl = ref_cast_non_const(Sortie_libre_pression_imposee_QC,la_cl.valeur());
cl.set_Pth(P);
}
}
}
|
anirudhrb/lisa
|
lisa/tools/hibernation_setup.py
|
<filename>lisa/tools/hibernation_setup.py
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from __future__ import annotations
import re
from typing import List, Pattern, Type
from lisa.executable import Tool
from lisa.util import find_patterns_in_lines
from .dmesg import Dmesg
from .git import Git
from .make import Make
from .service import Systemctl
class HibernationSetup(Tool):
_repo = "https://github.com/microsoft/hibernation-setup-tool"
# [ 159.967060] PM: hibernation entry
_entry_pattern = re.compile(r"^(.*hibernation entry.*)$", re.MULTILINE)
# [ 22.813227] PM: hibernation exit
_exit_pattern = re.compile(r"^(.*hibernation exit.*)$", re.MULTILINE)
# [ 159.898723] hv_utils: Hibernation request received
_received_pattern = re.compile(
r"^(.*Hibernation request received.*)$", re.MULTILINE
)
# [ 159.898806] hv_utils: Sent hibernation uevent
_uevent_pattern = re.compile(r"^(.*Sent hibernation uevent.*)$", re.MULTILINE)
@property
def command(self) -> str:
return "hibernation-setup-tool"
@property
def dependencies(self) -> List[Type[Tool]]:
return [Git, Make]
@property
def can_install(self) -> bool:
return True
def start(self) -> None:
self.run(
sudo=True,
expected_exit_code=0,
expected_exit_code_failure_message="fail to start",
)
def check_entry(self) -> int:
return self._check(self._entry_pattern)
def check_exit(self) -> int:
return self._check(self._exit_pattern)
def check_received(self) -> int:
return self._check(self._received_pattern)
def check_uevent(self) -> int:
return self._check(self._uevent_pattern)
def hibernate(self) -> None:
self.node.tools[Systemctl].hibernate()
def _install(self) -> bool:
tool_path = self.get_tool_path()
git = self.node.tools[Git]
git.clone(self._repo, tool_path)
code_path = tool_path.joinpath("hibernation-setup-tool")
make = self.node.tools[Make]
make.make_install(code_path)
return self._check_exists()
def _check(self, pattern: Pattern[str]) -> int:
dmesg = self.node.tools[Dmesg]
dmesg_output = dmesg.get_output(force_run=True)
matched_lines = find_patterns_in_lines(dmesg_output, [pattern])
if not matched_lines:
return 0
return len(matched_lines[0])
|
maxzhenzhera/my_vocab_backend
|
app/core/settings/app/mixins/logging_.py
|
from pydantic import (
BaseSettings,
Field,
SecretStr
)
from ...dataclasses_.logging_ import (
LoggingSettings,
TGLoggingSettings
)
__all__ = ['AppSettingsLoggingMixin']
class AppSettingsLoggingMixin(BaseSettings):
logging_level: str = Field('INFO', env='LOGGING_LEVEL')
logging_tg_token: SecretStr = Field(..., env='LOGGING_TG_TOKEN')
logging_tg_admins: list[str] = Field(..., env='LOGGING_TG_ADMINS')
@property
def logging(self) -> LoggingSettings:
return LoggingSettings(
level=self.logging_level,
tg=self._logging_tg
)
@property
def _logging_tg(self) -> TGLoggingSettings:
return TGLoggingSettings(
token=self.logging_tg_token.get_secret_value(),
admins=self.logging_tg_admins
)
|
graphcore/poprithms
|
poprithms/poprithms/include/poprithms/memory/nest/sett.hpp
|
// Copyright (c) 2020 Graphcore Ltd. All rights reserved.
#ifndef POPRITHMS_MEMORY_NEST_SETT_HPP
#define POPRITHMS_MEMORY_NEST_SETT_HPP
#include <vector>
#include <poprithms/memory/nest/optionalset.hpp>
#include <poprithms/memory/nest/stripe.hpp>
namespace poprithms {
namespace memory {
namespace nest {
// Online definition of "sett":
// > The particular pattern of stripes in a tartan
//
// Online etymology of "sett":
// > Middle English: variant of set, the spelling with -tt
// > prevailing in technical senses.
class Sett;
class DisjointSetts;
using OptionalSett1 = OptionalSet<1, Sett>;
using OptionalSett2 = OptionalSet<2, Sett>;
int64_t smallestCommonMultiple_i64(int64_t a, int64_t b);
/**
* Nested Stripes, used to represent more complicated periodic on-off
* patterns than what a single Stripe can.
*
* A Sett is completely defined by its lone class member,
* std::vector<Stripe> stripes;
*
* Some examples of the patterns defined by stripes:
*
* stripes = {{on=4,off=2,phase=0}} A single Stripe (no nesting, so this
* 1111..1111..1111.. etc is just the pattern described by a
* . single Stripe).
*
* stripes = {{on=6,off=2,phase=1}} A single Stripe, again.
* .111111..111111..111111.. etc
*
* stripes = {{on=2,off=1,phase=0}} A single Stripe, again.
* 11.11.11.11.11.11.11.11. etc
*
* stripes = {{on=6,off=2,phase=4}} Another single Stripe.
* 11..111111..111111..111111.. etc
*
* stripes = {} No Stripes, implies always on.
* 111111111111111111111111111 etc
*
* stripes = {{on=1,off=0,phase=0}} Another representation of
* 111111111111111111111111111 etc an always on Sett.
*
* stripes = {{on=5,off=3,phase=1}, 2 nested Stripes. The second Stripe is
* {on=2,off=1,phase=0}. nested within the first, and its
* .11.11...11.11...11.11...11.11 phase is relative to the first's.
*
* Note that nesting of Stripes is not intersection of Stripes. The second
* Stripe above is "restarted" every time the first (nesting) Stripe
* transitions from off to on:
*
* .11111...11111...11111...11111...11111 the first / outermost Stripe above
* 11.11.11.11 the inner Stripe, nesting 1
* =====
* 11.11.11.1 nesting 2
* =====
* 11.11.11.11. nesting 3
* =====
* 11.11 11.11 11.11 11.11 Sett described by the 2 Stripes.
*
* As another example
* {{on=1,off=2,phase=0},{on=1,off=0,phase=0}} is equivalent to
* {{on=1,off=2,phase=0}}, so the always on inner Stripe has no effect.
*
* However, an always on outer Stripe cannot be ignored:
* {{on=3,off=0,phase=0}, {on=1,off=1,phase=0}} looks like
* 1.11.11.11.11.11.11.11.11.1
* ===---===---===---===---===.
*
* stripes = {{on=6,off=2,phase=4},
* {on=2,off=1,phase=0} Another example of 2 nested Stripes.
* 1...11.11...11.11...11.11... etc
*
* stripes = {{on=5,off=2,phase=0},
* {on=1,off=1,phase=0} 2 nested Stripes, again. Note how the
* 1.1.1..1.1.1..1.1.1..1.1.1. etc nested Stripe's phase is relative to
* . the nesting Stripe's phase.
*
* stripes = {{on=8,off=8,phase=-2}, 3 nested Stripes
* {on=3,off=3,phase=1},
* {on=1,off=1,phase=0}.
* 111111........11111111........11111111........11111111 outermost
* 11...1 .111...1 .111...1 .111...1 middle
* .1 1 1.1 1 1.1 1 1.1 1 innermost
* .1...1.........1.1...1.........1.1...1.........1.1...1 final pattern.
*
* More examples can be seen in the test directory.
*
* Sett is a useful abstraction for representing regions of Tensors
* which are sliced, reshaped, etc. They serve a similar purpose in
* this project to Poplar's Tensor expression trees, and can be thought of as
* an extension to the boost::intervals used in there. Using
* a generalised interval such as the Sett means that less interval
* "shattering" happens, resulting in speed-ups for the higher level
* Graph transformations encountered at the ML frameworks level.
*
* Most of the methods of the class are standard set operations, where
* the set is the '1's described by class member variable, stripes.
* */
class Sett {
public:
Sett() = delete;
~Sett() = default;
Sett(const Sett &) = default;
Sett(Sett &&) = default;
Sett &operator=(const Sett &) = default;
Sett &operator=(Sett &&) = default;
/**
* Construct a Sett from a sequence of Stripes
*
* \param stripes_ Nested Stripes, with the innermost (most nested) Stripe
* being at the back of the vector and the outermost Stripe
* appearing first.
* */
Sett(const std::vector<Stripe> &stripes_) : Sett(stripes_, true) {}
/**
* Construct a Sett from a nested sequence of Stripes, and optionally
* perform canonicalization to simplify stripes.
*
* \param stripes_ Nested Stripes, with the most nested being the at the
* back of the vector and the outermost Stripe appearing
* first.
*
* \param canonicalize If true, try to simplify the Sett's stripes to an
* equivalent representation.
*
* As an example of canonicalization, {{1,1,0}, {2,2,0}} might become the
* equivalent but simpler {{1,1,0}}.
* */
Sett(const std::vector<Stripe> &stripes_, bool canonicalize);
/**
* Factory function to return an always '1' (always on) Sett.
*/
static Sett createAlwaysOn() { return {{}, false}; }
/**
* Factory function to return an always '0' (always off) Sett.
*/
static Sett createAlwaysOff() {
return {{Stripe{/*on=*/0, /*off=*/1, /*phase=*/0}},
/*canonicalize=*/false};
}
/**
* \return The smallest period over which this and rhs repeat. This is just
* the smallest common multiple of the periods of the outermost
* Stripes (if they not stripeless).
* */
int64_t smallestCommonMultiple(const Sett &rhs) const;
/**
* \return The smallest period over which a set of Setts repeat. This is
* just the smallest common multiple of the periods of the outermost
* Stripes (if not stripeless).
*
* \param setts The set to compute the smallest common period for.
* */
static int64_t smallestCommonMultiple_v(const std::vector<Sett> &setts);
/**
* Test for set equivalence.
*
* \return true, iff the positions at which this Sett is '1' (on) are the
* same as those for which rhs is '1'. Note that having the same
* Stripes implies equivalence, but equivalence does not imply the
* same Stripes. For example, the Setts with nested Stripes
* ((3,0,0)(1,1,0)) and ((2,1,2)) are equivalent, but have different
* Stripes.
* */
bool equivalent(const Sett &rhs) const;
/**
* Throw a descriptive error if rhs is not equivalent to this Sett.
* */
void confirmEquivalent(const Sett &rhs) const;
/**
* \param rhs Disjoint Setts.
*
* \return true iff the positions at which this Sett is '1' (on) are the
* same as the union over rhs.
*/
bool equivalent(const DisjointSetts &rhs) const;
/**
* \param rhs A set of disjoint Setts.
*
* Throw a descriptive error if the union of rhs is not equivalent to this
* Sett, otherwise do nothing.
*
* */
void confirmEquivalent(const DisjointSetts &rhs) const;
/**
* \return true iff this Sett is always off (always '0'). An example of
* when this is when one of the nested Stripes is always off,
* although it is also possible to be true when none of the nested
* Stripes are always off, but are misaligned. An example:
* ((1,2,0),(1,1,1)) is always off.
* */
bool alwaysOff() const;
/**
* If a Sett has no Stripes, it is always on. But an uncanonicalized Sett
* can be always on, and have Stripes. An example, ((5,0,3),(4,0,3),(5,5,0))
* is always on.
* */
bool hasStripes() const { return !stripes.empty(); }
/**
* Test that this is a superset of rhs.
*
* \return true iff (rhs is on at i implies that this on at i).
* */
bool contains(const Sett &rhs) const;
/**
* \return true iff the intersection with rhs is empty.
* */
bool disjoint(const Sett &rhs) const;
/**
* \param setts The set to test for pairwise disjointedness.
*
* \return false iff the intersection of any 2 elements of setts is
* non-empty.
* */
static bool disjoint(const std::vector<Sett> &setts);
/**
* \param begin The starting index.
*
* \return The first index with a '1' starting from index begin.
*
* Examples. If this is:
* ..11..11.1.........1
* 01234567890123456789
*
* find(0) = 2
* find(2) = 2
* find(5) = 6
* find(9) = 9
* find(10) = 19
*
* Negative values are also allowed, if this is:
* ..111..1...111..1111.1.11.111.11.1
* 9876543210123456789
*
* find(-8) = -6
* find(-6) = -6
* find(-3) = -1
* find(-1) = -1
* find(0) = 0
* find(3) = 3
* find(4) = 4
*
* */
int64_t find(int64_t begin) const;
/**
* Throw a descriptive error if the Setts in rhs are not disjoint.
* */
static void confirmDisjoint(const std::vector<Sett> &rhs);
/**
* \param setts A set of disjoint Setts
*
* \return true if and only if, for all i where this is on, there is at
* least 1 Sett in setts which is in on at i
* */
bool containedIn(const DisjointSetts &setts) const;
/**
* Partition this Sett into a set of Setts which repeat with
* periodicity 's'. Specifically, factorize this Sett into: {p00, p01}
* ... {pN0, pN1}. such that this Sett is the union of Sett partition,
* {{p00.getScaled(s), p01} ... {pN0.getScaled(s), pN1}}.
* */
std::vector<std::array<Sett, 2>> unflatten(int64_t s) const;
/**
* \param unfs A vector of (prefix, suffix) pairs of Setts
*
* \param scale The period to scale the prefix Setts by
*
* Example
* prefix = ((2,3,4),(1,1,0)), suffix ((5,6,7)), s = 10.
* The "scaled concatenation" is the depth-3 Sett,
* ((20,30,40), (10,10,0), (5,6,7)).
*
* \return The vector, obtained by performing the above scaled concatenation
* on all (prefix, suffix) pairs, followed by a canonicalization (removal of
* empty Setts, etc.).
*
* */
static std::vector<Sett>
scaledConcat(const std::vector<std::array<Sett, 2>> &unfs, int64_t scale);
/**
* Counting in the ordered set. Starting from index 0, at what index is the
* nthOn '1'?
*
* \param nthOn The number of '1's to visit before returning.
*
* \return The index at which the nthOn '1' appears.
*
* Examples:
*
* 1...1111
* getOn(0) = 0
* getOn(1) = 4.
*
* ..11..11...11.1
* getOn(0) = 2
* getOn(2) = 6.
*
* .11.11.11.11.11.11.11.11. (2,1,1)
* 9876543210123456789
* ========
* negative
* getOn(-3) = -4
* getOn(-2) = -2
* getOn(-1) = -1
* getOn( 0) = 1
* getOn( 1) = 2
* getOn( 2) = 3.
*
* */
int64_t getOn(int64_t nthOn) const;
/**
* \param start The (included) start of the range
*
* \param end The (excluded) end of the range
*
* Requirement: start <= end.
*
* \return Positions of all '1' values in [start, end), in ascending order
*
* */
std::vector<int64_t> getOns(int64_t start, int64_t end) const;
/**
* \return A boolean vector of length \p end - \p start. The value at index
* i is `true' if this Sett is on at position start + i, otherwise
* it is `false'.
* */
std::vector<bool> getBoolOns(int64_t start, int64_t end) const;
/**
* Number of '1's (ons) in a contiguous range.
* */
int64_t n(int64_t start, int64_t end) const;
int64_t n(int64_t end) const { return n(0, end); }
/**
* Set intersection
*
* \param a The first Sett in the intersection
*
* \param b The second Sett in the intersection
*
* \return The intersection of 2 Setts, represented as a union of
* disjoint Setts.
*
* Example:
* a : 1.1..1.11..1..11.1..1..11......11111.......11.. a
* b : .11.11..11..1.11.11.11.1....111111......11..... b
* => ..1..1..1.....11.1..1..1.......111............. the intersection
* */
static DisjointSetts intersect(const Sett &a, const Sett &b);
/**
* Intersect this Sett with rhs
* */
DisjointSetts intersect(const Sett &rhs) const;
/**
* Set "composition by division"
*
* \param sett The Sett to sample from
*
* \param filter The positions to sample at
*
* \return The sub-sampled Sett.
*
* Example:
* sett : 1..1..1.11....1.11...11..11...1.111.11.............11..11
* filter: .11...1.11.11..1.1111.1.1..11.11.1...........1.....111111
* .. 1 11 .. . 1... 1 . .. 1. 1 . 11..11
* return :
* => ..111...1...1...1.1.11..11
* */
static DisjointSetts sample(const Sett &sett, const Sett &filter);
DisjointSetts sampleAt(const Sett &filter) const;
/**
* Set "composition by multiplication"
*
* \param scaffold The positions at which to insert
*
* \param ink The 0/1s to insert
*
* \return The "super-sampled" (with zeros in gaps) Sett.
*
* Example:
* scaffold : 1..111.1..1.11.1..11.1.11..1.11.1.11.1..1111
* ink : .1..1.11...1.11.1..1.1..1
* . 1.. 1 . 11 . .. 1 .1 1 .1 . .1 . 1..1
* => ...1...1....11.......1..1..1..1....1....1..1 (super-sampled)
*
* Note, sample(fill(scaffold, ink), scaffold) = ink.
* Similarly, fill(indices, sample(x, indices)) is contained in x:
*
* ..111...1111..11...111..1111..... x
* 1..11.111...11..11...1.11...11.... indices
* . 11 ..1 .. .. 1 .1 11 sample(x, indices)
* ...11...1............1..1...11.... fill(indices, sample(x, indices))
*
* In suppary, where f = "filter" and s = "sample",
*
* f(i, s(x,i)) != x, but
* s(f(s, i), s) = i.
*
* */
static DisjointSetts fill(const Sett &scaffold, const Sett &ink);
DisjointSetts fillWith(const Sett &ink) const;
uint64_t recursiveDepth_u64() const { return stripes.size(); }
int recursiveDepth() const { return static_cast<int>(stripes.size()); }
/**
* \param d the depth at which to start copying Stripes
*
* \return A Sett constructed from Stripes at depths [d,
* recursiveDepth()).
*
* Example:
* If this is ((10,10,2), (4,2,2), (1,2,1)), then
* fromDepth(1) returns ((4,2,2), (1,2,1)).
* */
Sett fromDepth(int d) const;
const Stripe &atDepth(uint64_t i) const { return stripes[i]; }
const std::vector<Stripe> &getStripes() const { return stripes; }
/**
* Append logging information to ost.
* */
void append(std::ostream &ost) const;
/**
* \return A Sett identical to this, but with the outermost Stripe (if
* this Sett has any Stripes) phase shifted forward by deltaPhase0.
* */
Sett phaseShifted(int64_t deltaPhase0) const;
/**
* \param s0 The Stripe to prepend
*
* \return A Sett identitical to this but with a prepended (i.e.
* outermost) Stripe, and an adjusted phase of the first Stripe.
*
* Example:
* If this is ((1,1,1)) and s0 = (4, 2, 1) return ((4, 2, 1),(1, 1, 0)).
* .1.1.1.1.1.1. this
* .1111.. s0
*
* The adjustment of the first Stripe's phase is a common transformation
* when nesting Stripes.
* */
Sett adjustedPrepend(const Stripe &s0) const;
/**
* \param pivot The index at which to rotate this Sett
*
* Example
* If this Sett is ((3, 1, -1)), then reverse(8) is ((3, 1, -2)):
* 0 8
* .111.111.111.111.111
* <-----------
*
* In this example, reverse(0) is also ((3, 1, -1)).
*
* */
Sett getReverse(int64_t pivot) const;
/**
* \return The union of Setts representing the complement of this
* (0<->1).
*
* Example:
* 1.11..1.11.11..11.11.1....11.111.1.1 (this)
* .1..11.1..1..11..1..1.1111..1...1.1. (to return)
*
* */
DisjointSetts getComplement() const;
/**
* \param rhs The Sett to subtract from this Sett.
*
* \return The intersection of this and the complement of rhs.
*
* Example:
* 11111...11111... this
* ..11111...11111. rhs
* 11.....111.....1 rhs's complement
* 11......11...... returned.
*
* The retured Sett is the set of all indices which are '1' in this and
* not '1' in rhs.
* */
DisjointSetts subtract(const Sett &rhs) const;
/**
* \return A vector of size smallest-common-multiple of rhs, where element i
* is the number of Setts "x" in rhs for which "x" is on at i.
* */
static std::vector<int> getRepeatingOnCount(const std::vector<Sett> &rhs);
/**
* Attempt to merge two disjoint Setts.
* */
static OptionalSett1 merge(const Sett &, const Sett &);
/**
* Attempt to transform two disjoint Setts into two simpler Setts.
* */
static OptionalSett2 transfer(const Sett &, const Sett &);
/**
* The first depth at which this and rhs have a different Stripe.
* */
int depthWhereFirstDifference(const Sett &rhs) const;
/**
* \param setts Setts to be canonicalized
*
* \return Merged and shortened, but equivalent version of setts.
* */
static DisjointSetts canonicalized(const DisjointSetts &setts);
int64_t period() const { return hasStripes() ? atDepth(0).period() : 1; }
private:
/**
* \param p the non-crossing period, it must be a factor of the outermost
* Stripe's period.
*
* \return A partition of this Sett into 1 or 3 Setts, based on the
* first (outermost) Stripe's phase and period. The partition
* consists of "overflows" on the edges, if there are any, and the
* main repeated section.
*
* Example: If this is ((3,2,4)) and p is 20
* 11..111..111..111..111..111..111..111..111
* 0 0 0
* == ------------- +== ------------- +==
* == : incomplete 1s at begin
* -- : complete 1s in interior
* + : incomplete 1s at end
*
* Example 2: If this is ((3,2,2)) and p is 20
* ..111..111..111..111..111..111..111..111
* 0 0 0
* ----------------- ------------------
* in this example, there is no incomplete start or end, so {*this} is
* returned.
*
* */
DisjointSetts getNonCrossingB(int64_t p) const;
DisjointSetts getNonCrossingPeriodic(int64_t p, int64_t upper) const;
std::array<Sett, 2> getPeriodSplit() const;
// If Sett "b" looks like a slice of the first or final Stripe of "a" at
// any depth, or first Stripe at any depth, paste them together. Example
// 11.11.......11.11..., and
// ......11..........11.
//
// + (d, d+1) -> d+1
//
static OptionalSett1 mergeA(const Sett &, const Sett &);
// Concatentate two Setts at any depth if they fit "seemlessly"
// Example:
// 11111111......11111111..
// ........11............11
//
// + (d, d) -> d
//
static OptionalSett1 mergeB(const Sett &, const Sett &);
// insert an intermediate Stripe to merge 2 Setts
// Example:
// .11......11..... (...)(2, 6, 1)(...)
// ....11......11.. (...)(2, 6, 4)(...)
// becomes
// (...)(5, 3, 1)(2, 1, 0)(...)
//
// + (d, d) -> d+1
//
static OptionalSett1 mergeC(const Sett &, const Sett &);
// Example 1:
// ....11..........11....... (...)(2,10,4)
// ......1.1.........1.1.... (...)(3,9,6)(1,1,0)
// (...)(3,9,4) and (...)(1,11,8)
//
// Example 2:
// ......1111........1111........1111.......
// 11.11 11.11 11.11
//
//
// + (d, d+1) -> (d, d)
//
static OptionalSett2 transferA(const Sett &, const Sett &);
void canonicalize();
// The recursive implementation of Sett::n
int64_t nRecursive(uint64_t depth, int64_t start, int64_t end) const;
// The recursive implementation of Sett::getOns
std::vector<int64_t>
getOnsRecurse(uint64_t depth, int64_t start, int64_t end) const;
/**
* The recursive implementation of Sett::unflatten.
*
* \param period The value which all prefixes must have as a factor of
* their periods.
*
* \param heightLimit There is only a requirement that the returned vector
* is correct in the range [0, heightLimit) of the
* prefixes. In other words, if this Sett changes outside
* of the range [0, heightLimit*period), the returned
* vector from this function does not need to change.
*
* \param depth The recursive depth of the call. Used only for debugging.
* */
std::vector<std::array<Sett, 2>>
unflattenRecurse(int64_t period, int64_t heightLimit, int depth) const;
// The recursive implementation of Sett::getOn
int64_t getOnRecurse(int64_t nthOn) const;
/**
* The recursive implementation of Sett::intersect, with 3 additional
* arguments to accelerate the algorithm.
*
* \param lowCorrect The intersection is only required to be correct in the
* range [lowCorrect, uppCorrect). See param uppCorrect.
*
* \param uppCorrect The intersection is only required to be correct in the
* range [lowCorrect, uppCorrect). See param lowCorrect.
*
* \param depth carry the depth of the recursion so that it is known at any
* time - only used for debugging.
*
*
* By carrying lowCorrect and uppCorrect down through the recursion, and
* progressively making the required boud of correctness narrower, the
* algorithm avoids computing intersections of Setts which will eventually
* be unused.
* */
static DisjointSetts intersectRecurse(const Sett &lhs,
const Sett &rhs,
uint64_t depth,
int64_t lowCorrect,
int64_t uppCorrect);
// The recursive implementation of Sett::fill
static DisjointSetts fillRecurse(const Sett &scaffold,
const Sett &ink,
int depth,
int64_t scaffoldUpp);
/**
* The recursive implementation of Sett::sample, with 2 additional
* parameters:
*
* \param lowCorrect The sampling is only required to be correct in the
* final range [lowCorrect, uppCorrect).
*
* */
static DisjointSetts sampleRecurse(const Sett &x,
const Sett &filter,
int depth,
int64_t lowCorrect,
int64_t uppCorrect);
void appendStripes(const std::vector<Stripe> &s) {
stripes.insert(stripes.end(), s.cbegin(), s.cend());
}
void changeFirstStripe(const Stripe &s0) { stripes[0] = s0; }
void prependStripes(const std::vector<Stripe> &s) {
stripes.insert(stripes.begin(), s.cbegin(), s.cend());
}
DisjointSetts getNonCrossingA(int64_t l0, int64_t u0) const;
void shiftPhase(int64_t deltaPhase0);
private:
// The nested Stripes which completely define this Sett
std::vector<Stripe> stripes;
};
class DisjointSetts {
private:
// This DisjointSetts is represented by the union of these disjoint Setts
std::vector<Sett> setts_;
public:
DisjointSetts() = default;
/**
* \param s a vector of disjoint Setts. If the Setts in s are not all
* disjoint, the behavior is if the object constructed is undefined.
* */
explicit DisjointSetts(const std::vector<Sett> &s) : setts_(s) {}
explicit DisjointSetts(std::vector<Sett> &&s) : setts_(std::move(s)) {}
DisjointSetts(const Sett &s) : setts_({s}) {}
decltype(setts_.begin()) begin() { return setts_.begin(); }
decltype(setts_.cbegin()) cbegin() const { return setts_.cbegin(); }
decltype(setts_.end()) end() { return setts_.end(); }
decltype(setts_.cend()) cend() const { return setts_.cend(); }
size_t size() const { return setts_.size(); }
bool empty() const { return setts_.empty(); }
const std::vector<Sett> &get() const { return setts_; }
std::vector<Sett> &get() { return setts_; }
const Sett &operator[](size_t i) const { return setts_[i]; }
Sett &operator[](size_t i) { return setts_[i]; }
bool equivalent(const DisjointSetts &rhs) const;
int64_t totalOns(int64_t end) const;
};
std::ostream &operator<<(std::ostream &stream, const Sett &);
std::ostream &operator<<(std::ostream &stream, const std::vector<Sett> &);
std::ostream &operator<<(std::ostream &stream, const DisjointSetts &);
std::ostream &operator<<(std::ostream &stream, const OptionalSett1 &);
} // namespace nest
} // namespace memory
} // namespace poprithms
#endif
|
icco/fog
|
lib/fog/go_grid/requests/compute/grid_server_power.rb
|
module Fog
module Compute
class GoGrid
class Real
# Start, Stop or Restart a server
#
# ==== Parameters
# * 'server'<~String> - id or name of server to power
# * 'power'<~String> - power operation, in ['restart', 'start', 'stop']
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Array>:
# TODO: docs
def grid_server_power(server, power)
request(
:path => 'grid/server/power',
:query => {'server' => server, 'power' => power}
)
end
end
end
end
end
|
lizzie2008/rapid4you
|
rapid-api/rapid-api-web/src/main/java/tech/lancelot/controller/storage/AliOssController.java
|
<filename>rapid-api/rapid-api-web/src/main/java/tech/lancelot/controller/storage/AliOssController.java
package tech.lancelot.controller.storage;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.model.ListObjectsRequest;
import com.aliyun.oss.model.OSSObjectSummary;
import com.aliyun.oss.model.ObjectListing;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import tech.lancelot.annotations.Log;
import tech.lancelot.domain.tools.StorageConfig;
import tech.lancelot.dto.AliOssDto;
import tech.lancelot.service.storage.AliOssService;
import tech.lancelot.utils.FileUtil;
import tech.lancelot.utils.PageUtil;
import tech.lancelot.vo.Result;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author lancelot
*/
@RestController
@RequiredArgsConstructor
@Api(tags = "ๅทฅๅ
ท๏ผ้ฟ้ไบๅญๅจ็ฎก็")
@RequestMapping("/api/ali-oss")
public class AliOssController {
private final AliOssService aliOssService;
@GetMapping(value = "/config")
public Result queryConfig() {
return Result.success(aliOssService.getConfig());
}
@Log("้
็ฝฎ้ฟ้ไบOss")
@ApiOperation("้
็ฝฎ้ฟ้ไบOss")
@PutMapping(value = "/config")
public Result updateConfig(@Validated @RequestBody StorageConfig config) {
aliOssService.update(config);
return Result.success();
}
@Log("่ทๅOSS็ฎๅฝ")
@ApiOperation("่ทๅOSS็ฎๅฝ")
@GetMapping
@PreAuthorize("@el.check('ali-oss:list')")
public Result getFolders(@RequestParam(defaultValue = "") String prefix) {
return Result.success(aliOssService.getFolders(prefix));
}
@Log("ไธไผ ๆไปถ")
@ApiOperation("ไธไผ ๆไปถ")
@PostMapping(value = "/upload")
public Result upload(@RequestParam MultipartFile file, @RequestParam(defaultValue = "") String prefix) {
aliOssService.upload(file, prefix);
return Result.success();
}
}
|
scottwedge/OpenStack-Stein
|
freezer-7.1.0/freezer/scheduler/win_daemon.py
|
# Copyright 2015 Hewlett-Packard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
import os
import win32serviceutil
from freezer.utils import utils
from freezer.utils import winutils
def setup_logging(log_file):
class NoLogFilter(logging.Filter):
def filter(self, record):
return False
def configure_logging(file_name):
expanded_file_name = os.path.expanduser(file_name)
expanded_dir_name = os.path.dirname(expanded_file_name)
utils.create_dir(expanded_dir_name, do_log=False)
logging.basicConfig(
filename=expanded_file_name,
level=logging.INFO,
format=('%(asctime)s %(name)s %(levelname)s %(message)s'))
# filter out some annoying messages
# not the best position for this code
log_filter = NoLogFilter()
logging.getLogger("apscheduler.scheduler").\
addFilter(log_filter)
logging.getLogger("apscheduler.executors.default").\
addFilter(log_filter)
logging.getLogger("requests.packages.urllib3.connectionpool").\
addFilter(log_filter)
return expanded_file_name
log_file_paths = [log_file] if log_file else [
r'C:\.freezer\freezer-scheduler.log']
for file_name in log_file_paths:
try:
return configure_logging(file_name)
except IOError:
pass
raise Exception("Unable to write to log file")
class Daemon(object):
"""Daemon interface to start a windows service with a freezer-scheduler
instance
"""
def __init__(self, daemonizable=None, interval=None, job_path=None,
insecure=False, concurrent_jobs=1):
self.service_name = 'FreezerService'
self.home = r'C:\.freezer'
# this is only need it in order to have the same interface as in linux
self.daemonizable = daemonizable
self.interval = interval or 60
self.job_path = job_path or r'C:\.freezer\scheduler\conf.d'
self.insecure = insecure
self.concurrent_jobs = concurrent_jobs
@utils.shield
def start(self, log_file=None):
"""Initialize freezer-scheduler instance inside a windows service
"""
setup_logging(log_file)
utils.create_dir(self.home)
if self.insecure:
os.environ['SERVICE_INSECURE'] = 'True'
# send arguments info to the windows service
os.environ['SERVICE_JOB_PATH'] = self.job_path
os.environ['SERVICE_INTERVAL'] = str(self.interval)
os.environ['SERVICE_CONCURRENT_JOBS'] = str(self.concurrent_jobs)
winutils.save_environment(self.home)
print('Freezer Service is starting')
win32serviceutil.StartService(self.service_name)
@utils.shield
def reload(self):
"""Reload the windows service
"""
win32serviceutil.RestartService(self.service_name)
@utils.shield
def stop(self):
"""Stop the windows service by using sc queryex command, if we use
win32serviceutil.StoptService(self.service_name) it never gets stopped
because freezer_scheduler.start() blocks the windows service and
prevents any new signal to reach the service.
"""
query = 'sc queryex {0}'.format(self.service_name)
out = utils.create_subprocess(query)[0]
pid = None
for line in out.split('\n'):
if 'PID' in line:
pid = line.split(':')[1].strip()
command = 'taskkill /f /pid {0}'.format(pid)
utils.create_subprocess(command)
print('Freezer Service has stopped')
@utils.shield
def status(self):
"""Return running status of Freezer Service
by querying win32serviceutil.QueryServiceStatus()
possible running status:
1 == stop
4 == running
"""
if win32serviceutil.QueryServiceStatus(self.service_name)[1] == 4:
print("{0} is running normally".format(self.service_name))
else:
print("{0} is *NOT* running".format(self.service_name))
class NoDaemon(object):
"""A class that share the same interface as the Daemon class but doesn't
initialize a windows service to execute the scheduler, it runs in the
foreground
"""
def __init__(self, daemonizable=None):
# this is only need it in order to have the same interface as in linux
self.daemonizable = daemonizable
@utils.shield
def stop(self):
self.daemonizable.stop()
def status(self):
"""Need it to have the same interface as Daemon
"""
pass
def reload(self):
"""Need it to have the same interface as Daemon
"""
pass
@utils.shield
def start(self, log_file=None):
self.daemonizable.start()
|
sigurasg/ghidra
|
Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramSelection.java
|
<filename>Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramSelection.java
/* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ghidra.program.util;
import java.util.Iterator;
import ghidra.program.model.address.*;
/**
* Class to define a selection for a program.
*/
public class ProgramSelection implements AddressSetView {
private AddressSet addressSet;
private InteriorSelection interiorSelection;
/**
* Construct a new empty ProgramSelection.
*/
public ProgramSelection() {
this((AddressFactory) null);
}
/**
* Construct a new empty ProgramSelection.
* @param addressFactory the address factory for the address set
* associated with this program selection.
*/
public ProgramSelection(AddressFactory addressFactory) {
addressSet = new AddressSet();
}
/**
* Constructor.
* @param from the start of the selection
* @param to the end of the selection
*/
public ProgramSelection(Address from, Address to) {
this(null, from, to);
}
/**
* Constructor.
* @param addressFactory the address factory for the address set
* associated with this program selection.
* @param from the start of the selection
* @param to the end of the selection
*/
public ProgramSelection(AddressFactory addressFactory, Address from, Address to) {
this(addressFactory);
if (to.compareTo(from) < 0) {
Address temp = to;
to = from;
from = temp;
}
addressSet.addRange(from, to);
}
/**
* Construct a new ProgramSelection
* @param setView address set for the selection
*/
public ProgramSelection(AddressSetView setView) {
this(null, setView);
}
/**
* Construct a new ProgramSelection
* @param addressFactory the address factory for the address set
* associated with this program selection.
* @param setView address set for the selection
*/
public ProgramSelection(AddressFactory addressFactory, AddressSetView setView) {
addressSet = new AddressSet(setView);
}
/**
* Construct a new ProgramSelection from the indicated interior selection.
* @param addressFactory the address factory for the address set
* associated with this program selection.
* @param sel the interior selection
*/
public ProgramSelection(AddressFactory addressFactory, InteriorSelection sel) {
this(addressFactory, sel.getStartAddress(), sel.getEndAddress());
interiorSelection = sel;
}
/**
* Construct a new ProgramSelection from the indicated interior selection.
* @param sel the interior selection
*/
public ProgramSelection(InteriorSelection sel) {
this(null, sel);
}
/**
* Get the interior selection.
* @return null if there is no interior selection
*/
public InteriorSelection getInteriorSelection() {
return interiorSelection;
}
/**
* Return whether this ProgramSelection is equal to obj.
*/
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (this == obj) {
return true;
}
if (getClass() != obj.getClass()) {
return false;
}
ProgramSelection ps = (ProgramSelection) obj;
if (interiorSelection != null) {
return interiorSelection.equals(ps.interiorSelection);
}
return addressSet.hasSameAddresses(ps.addressSet);
}
/**
* Test if the address exists within this set.
* <P>
* @param addr address to test.
* @return true if addr exists in the set, false otherwise.
*/
@Override
public boolean contains(Address addr) {
return addressSet.contains(addr);
}
/**
* Test if the given address range is in the set.
* <P>
* @param start the first address in the range.
* @param end the last address in the range.
* @return true if entire range is contained within the set,
* false otherwise.
*/
@Override
public boolean contains(Address start, Address end) {
return addressSet.contains(start, end);
}
/**
* Test if the given address set is a subset of this set.
* <P>
* @param rangeSet the set to test.
* @return true if the entire set is contained within this set,
* false otherwise.
*/
@Override
public boolean contains(AddressSetView rangeSet) {
return addressSet.contains(rangeSet);
}
/**
* Determine if this program selection intersects with the specified address set.
*
* @param addrSet address set to check intersection with.
*/
@Override
public boolean intersects(AddressSetView addrSet) {
return addressSet != null ? addressSet.intersects(addrSet) : false;
}
/**
* @see ghidra.program.model.address.AddressSetView#intersect(ghidra.program.model.address.AddressSetView)
*/
@Override
public AddressSet intersect(AddressSetView view) {
return addressSet.intersect(view);
}
/**
* @see ghidra.program.model.address.AddressSetView#intersectRange(ghidra.program.model.address.Address, ghidra.program.model.address.Address)
*/
@Override
public AddressSet intersectRange(Address start, Address end) {
return addressSet.intersectRange(start, end);
}
/**
* Returns true if this set is empty.
*/
@Override
public boolean isEmpty() {
return addressSet.isEmpty();
}
/**
* Return the minimum address for this set.
*/
@Override
public Address getMinAddress() {
return addressSet.getMinAddress();
}
/**
* Return the maximum address for this set.
*/
@Override
public Address getMaxAddress() {
return addressSet.getMaxAddress();
}
/**
* Return the number of address ranges in this set.
*/
@Override
public int getNumAddressRanges() {
return addressSet.getNumAddressRanges();
}
/**
* Returns an iterator over the address ranges in this address set.
* @param atStart if true, the iterator is positioned at the minimum address.
* if false, the iterator is positioned at the maximum address.
*/
@Override
public AddressRangeIterator getAddressRanges(boolean atStart) {
return addressSet.getAddressRanges(atStart);
}
/**
* Returns an iterator over the address ranges in this address set.
*/
@Override
public AddressRangeIterator getAddressRanges() {
return addressSet.getAddressRanges();
}
@Override
public Iterator<AddressRange> iterator() {
return getAddressRanges();
}
/**
* Returns the number of addresses in this set.
*/
@Override
public long getNumAddresses() {
return addressSet.getNumAddresses();
}
/**
* @see ghidra.program.model.address.AddressSetView#getAddresses(boolean)
*/
@Override
public AddressIterator getAddresses(boolean forward) {
return addressSet.getAddresses(forward);
}
/**
* @see ghidra.program.model.address.AddressSetView#getAddresses(ghidra.program.model.address.Address, boolean)
*/
@Override
public AddressIterator getAddresses(Address start, boolean forward) {
return addressSet.getAddresses(start, forward);
}
/**
* Returns true if and only if this set and the given
* address set contains exactly the same addresses.
* @param asv the address set to compare with this one.
* @return true if the specified set has the same addresses.
*/
@Override
public boolean hasSameAddresses(AddressSetView asv) {
if (asv instanceof ProgramSelection) {
return equals(asv);
}
return addressSet.hasSameAddresses(asv);
}
/**
* @see AddressSetView#intersects(Address, Address)
*/
@Override
public boolean intersects(Address start, Address end) {
return addressSet.intersects(start, end);
}
/**
* @see ghidra.program.model.address.AddressSetView#union(ghidra.program.model.address.AddressSetView)
*/
@Override
public AddressSet union(AddressSetView view) {
return addressSet.union(view);
}
/**
* @see ghidra.program.model.address.AddressSetView#xor(ghidra.program.model.address.AddressSetView)
*/
@Override
public AddressSet xor(AddressSetView view) {
return addressSet.xor(view);
}
/**
* @see ghidra.program.model.address.AddressSetView#subtract(ghidra.program.model.address.AddressSetView)
*/
@Override
public AddressSet subtract(AddressSetView view) {
return addressSet.subtract(view);
}
/* (non Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
if (interiorSelection != null) {
return "Interior Selection: " + interiorSelection;
}
return "ProgramSelection: " + addressSet;
}
@Override
public AddressRangeIterator getAddressRanges(Address start, boolean forward) {
return addressSet.getAddressRanges(start, forward);
}
@Override
public AddressRange getFirstRange() {
return addressSet.getFirstRange();
}
@Override
public AddressRange getLastRange() {
return addressSet.getLastRange();
}
@Override
public AddressRange getRangeContaining(Address address) {
return addressSet.getRangeContaining(address);
}
@Override
public Iterator<AddressRange> iterator(boolean forward) {
return addressSet.iterator(forward);
}
@Override
public Iterator<AddressRange> iterator(Address start, boolean forward) {
return addressSet.iterator(start, forward);
}
@Override
public Address findFirstAddressInCommon(AddressSetView set) {
return addressSet.findFirstAddressInCommon(set);
}
}
|
mdvx/TimeBase
|
java/timebase/server/src/main/java/deltix/qsrv/hf/tickdb/lang/runtime/RawMessageSet.java
|
package deltix.qsrv.hf.tickdb.lang.runtime;
import deltix.qsrv.hf.pub.RawMessage;
import java.util.HashSet;
/**
*
*/
public final class RawMessageSet {
private final HashSet <RawMessage> ms = new HashSet <RawMessage> ();
public boolean alreadyContains (RawMessage msg) {
if (ms.contains (msg))
return (true);
ms.add ((RawMessage) msg.clone ());
return (false);
}
}
|
roboterclubaachen/xpcc
|
src/xpcc/math/filter/fir_impl.hpp
|
// coding: utf-8
// ----------------------------------------------------------------------------
/* Copyright (c) 2009, Roboterclub Aachen e.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Roboterclub Aachen e.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ROBOTERCLUB AACHEN E.V. ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ROBOTERCLUB AACHEN E.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// ----------------------------------------------------------------------------
#ifndef XPCC__FIR_IMPL_HPP
#define XPCC__FIR_IMPL_HPP
#include <xpcc/architecture/utils.hpp>
//#define FIR_DEBUG
#ifdef FIR_DEBUG
#include <stdio.h>
//#define FIR_DEBUG_APPEND
#define FIR_DEBUG_UPDATE
#ifdef FIR_DEBUG_UPDATE
#define FIR_DEBUG_SUM(tap, coeff) printf("sum += %.3f * %.3f;\n", tap, coeff)
#else
#define FIR_DEBUG_SUM(tap, coeff)
#endif /*FIR_DEBUG_UPDATE*/
#else
#define FIR_DEBUG_SUM(tap, coeff)
#endif /*FIR_DEBUG*/
template<typename T, int N, int BLOCK_SIZE, signed int ScaleFactor>
xpcc::filter::Fir<T, N, BLOCK_SIZE, ScaleFactor>::Fir(const float (&coeff)[N])
{
setCoefficients(coeff);
reset();
}
// -----------------------------------------------------------------------------
template<typename T, int N, int BLOCK_SIZE, signed int ScaleFactor>
void
xpcc::filter::Fir<T, N, BLOCK_SIZE, ScaleFactor>::setCoefficients(const float (&coeff)[N])
{
for(int i = 0; i < N; i++){
coefficients[i] = static_cast<T>(coeff[i] * ScaleFactor);
}
}
// -----------------------------------------------------------------------------
template<typename T, int N, int BLOCK_SIZE, signed int ScaleFactor>
void
xpcc::filter::Fir<T, N, BLOCK_SIZE, ScaleFactor>::reset()
{
// reset all to make debugging easier
for(int i = 0; i < N + BLOCK_SIZE; i++){
taps[i] = (T)0;
}
taps_index = BLOCK_SIZE;
}
// -----------------------------------------------------------------------------
template<typename T, int N, int BLOCK_SIZE, signed int ScaleFactor>
void
xpcc::filter::Fir<T, N, BLOCK_SIZE, ScaleFactor>::append(const T& input)
{
#ifdef FIR_DEBUG_APPEND
printf("append(%f);\ttaps_index=%d\n", input, taps_index);
printf("BEFORE: ");
for(int i = 0; i < N + BLOCK_SIZE; i++)
if(i >= taps_index && i-taps_index < N) printf("n-%d:%.3f; ", i-taps_index, taps[i]);
else printf("(%.3f) ", taps[i]);
printf("\n");
#endif // FIR_DEBUG_APPEND
if(xpcc_likely(taps_index > 0)){
taps_index--;
}
else{
for(int i = N + BLOCK_SIZE - 1; i > BLOCK_SIZE; i--)
taps[i] = taps[i - BLOCK_SIZE - 1];
taps_index = BLOCK_SIZE;
}
taps[taps_index] = input;
#ifdef FIR_DEBUG_APPEND
printf(" AFTER: ");
for(int i = 0; i < N + BLOCK_SIZE; i++)
if(i >= taps_index && i-taps_index < N) printf("n-%d:%.3f; ", i-taps_index, taps[i]);
else printf("(%.3f) ", taps[i]);
printf("\n\n");
#endif // FIR_DEBUG_APPEND
}
// -----------------------------------------------------------------------------
template<typename T, int N, int BLOCK_SIZE, signed int ScaleFactor>
void
xpcc::filter::Fir<T, N, BLOCK_SIZE, ScaleFactor>::update()
{
#ifdef FIR_DEBUG_UPDATE
printf("update();\ttaps_index=%d\n", taps_index);
for(int i = 0; i < N + BLOCK_SIZE; i++)
if(i >= taps_index && i-taps_index < N) printf("n-%d:%.3f; ", i-taps_index, taps[i]);
else printf("(%.3f) ", taps[i]);
printf("\n");
#endif // FIR_DEBUG_UPDATE
T sum = (T)0;
T *tap = taps + taps_index;
for(int i = 0; i < (N - (N%4)); i++){
FIR_DEBUG_SUM(tap[i], coefficients[i]);
sum += tap[i]*coefficients[i]; i++;
FIR_DEBUG_SUM(tap[i], coefficients[i]);
sum += tap[i]*coefficients[i]; i++;
FIR_DEBUG_SUM(tap[i], coefficients[i]);
sum += tap[i]*coefficients[i]; i++;
FIR_DEBUG_SUM(tap[i], coefficients[i]);
sum += tap[i]*coefficients[i];
}
for(int i = (N - (N%4)); i < N; i++){
FIR_DEBUG_SUM(tap[i], coefficients[i]);
sum += tap[i]*coefficients[i];
}
output = sum / ScaleFactor;
#ifdef FIR_DEBUG_UPDATE
printf("sum=%.3f\n", output);
#endif // FIR_DEBUG_UPDATE
}
#endif // XPCC__FIR_IMPL_HPP
|
mohnoor94/LearningScala
|
src/main/scala/_060_lazy_vals/_08_lazy_stream/EmptyStream.scala
|
<reponame>mohnoor94/LearningScala
package _060_lazy_vals._08_lazy_stream
object EmptyStream extends MyStream[Nothing] {
override def isEmpty: Boolean = true
override def head: Nothing = throw new NoSuchElementException("No head on empty stream!")
override def tail: MyStream[Nothing] = throw new NoSuchElementException("No tail on empty stream!")
override def #::[B >: Nothing](element: B): MyStream[B] = new Cons[B](element, this)
override def ++[B >: Nothing](anotherStream: MyStream[B]): MyStream[B] = anotherStream
override def foreach(f: Nothing => Unit): Unit = ()
override def map[B](f: Nothing => B): MyStream[B] = this
override def flatMap[B](f: Nothing => MyStream[B]): MyStream[B] = this
override def filter(predicate: Nothing => Boolean): MyStream[Nothing] = this
override def take(n: Int): MyStream[Nothing] = this
override def takeAsList(n: Int): List[Nothing] = List.empty[Nothing]
}
|
AngelEngineer314/Huru_Front_Mobile_App
|
src/screen/category/Category.js
|
import React, { useState, useEffect, useRef, useImperativeHandle } from 'react';
import {
SafeAreaView, View, Text, Dimensions, TouchableOpacity, StyleSheet
} from 'react-native';
import BottomSheet from '../../components/modules/react-native-gesture-bottom-sheet/src/BottomSheet';
import Dashboard from '../dashboard/Content'
import Articles from '../article/Articles'
import Analytics from '../analytics/Analytics'
import Settings from '../settings/Settings';
import CategoryScreenModal from '../../components/category/CategoryScreenModal'
import CategoryScreen from './CategoryScreen'
import SubCategoryScreen from './SubCategoryScreen'
import InterviewListScreen from './InterviewListScreen'
import InterviewScreen from './InterviewScreen'
import TabNavBar from '../../layout/tabBar/TabNavBar'
const windowHeight = Dimensions.get('window').height;
const CategoryGroup = props => {
const { onMoveScreenGroup, onMoveTab, focusedTab, latestTab, categoryRef } = props
const [modalVisible, setModalVisible] = useState(true);
const [selectedScreen, setSelectedScreen] = useState('category')
const [selectedItem, setSelectedItem] = useState('')
const [previousItem, setPreviousItem] = useState('')
const bottomSheetRef = useRef()
useEffect(() => {
setSelectedScreen('category')
bottomSheetRef.current.show();
return () => {
// cleanup
}
}, [bottomSheetRef])
useImperativeHandle(categoryRef, () => ({
showBottomSheet() {
bottomSheetRef.current.show();
// alert("Child function called")
}
}));
const handleMovedScreen = ( selectedScreen, previousItem, selectedItem) => {
setSelectedScreen(selectedScreen)
setSelectedItem(selectedItem)
setPreviousItem(previousItem)
}
const handleVisibleModal = () => {
setModalVisible(!modalVisible)
}
return (
<>
<SafeAreaView>
<BottomSheet
hasDraggableIcon
dragIconColor={"#013551"}
dragBackgroundColor={selectedScreen !== 'interview' ? "#ffffff" : "#FFF5EC"}
draggable={false}
ref={bottomSheetRef}
height={windowHeight * 0.97}
>
{/* {selectedScreen === 'categoryScreenModal' ?
<CategoryScreenModal isModalVisible={modalVisible} onVisibleModal={handleVisibleModal} onMoveScreen={handleMovedScreen} onMoveTab={onMoveTab} focusedTab={focusedTab}/> : null } */}
{selectedScreen === 'category' ?
<>
<CategoryScreen onMoveScreen={handleMovedScreen} />
<TabNavBar onMoveTab={onMoveTab} focusedTab={focusedTab}/>
</> : null}
{selectedScreen === 'subCategory' ?
<>
<SubCategoryScreen onMoveScreen={handleMovedScreen} selectedItem={selectedItem} previousItem={previousItem}/>
<TabNavBar onMoveTab={onMoveTab} focusedTab={focusedTab}/>
</> : null}
{selectedScreen === 'interviewList' ?
<>
<InterviewListScreen onMoveScreen={handleMovedScreen} selectedItem={selectedItem} previousItem={previousItem}/>
<TabNavBar onMoveTab={onMoveTab} focusedTab={focusedTab}/>
</> : null}
{selectedScreen === 'interview' ? <InterviewScreen onMoveTab={onMoveTab} onMoveScreen={handleMovedScreen} selectedItem={selectedItem} previousItem={previousItem}/> : null}
</BottomSheet>
</SafeAreaView>
<>
{latestTab === 'dashboard' ? <Dashboard onMoveScreenGroup={onMoveScreenGroup} onMoveTab={onMoveTab} focusedTab={latestTab} /> : null}
{latestTab === 'article' ? <Articles onMoveScreenGroup={onMoveScreenGroup} onMoveTab={onMoveTab} focusedTab={latestTab} /> : null}
{latestTab === 'analytics' ? <Analytics onMoveScreenGroup={onMoveScreenGroup} onMoveTab={onMoveTab} focusedTab={latestTab} /> : null}
{latestTab === 'settings' ? <Settings onMoveScreenGroup={onMoveScreenGroup} onMoveTab={onMoveTab} focusedTab={latestTab} /> : null}
</>
</>
);
};
export default CategoryGroup
|
SatYu26/DS-Algo
|
Happy Number/solution.py
|
class Solution:
def isHappy(self, n: int) -> bool:
if n==1:
return True
while True:
res=0
while(n>0):
r=n%10
res+=(r**2)
n=n//10
print(res)
if res==1:
return True
if res<7:
return False
n=res
|
JasonLeeSJTU/Algorithms_Python
|
jianzhi_offer_36.py
|
#!/usr/bin/env python
# encoding: utf-8
'''
@author: <NAME>
@license: (C) Copyright @ <NAME>
@contact: <EMAIL>
@file: jianzhi_offer_36.py
@time: 2019/3/24 21:39
@desc:
้ข็ฎๆ่ฟฐ:
ๅจๆฐ็ปไธญ็ไธคไธชๆฐๅญ๏ผๅฆๆๅ้ขไธไธชๆฐๅญๅคงไบๅ้ข็ๆฐๅญ๏ผๅ่ฟไธคไธชๆฐๅญ็ปๆไธไธช้ๅบๅฏนใ
่พๅ
ฅไธไธชๆฐ็ป,ๆฑๅบ่ฟไธชๆฐ็ปไธญ็้ๅบๅฏน็ๆปๆฐPใๅนถๅฐPๅฏน1000000007ๅๆจก็็ปๆ่พๅบใ
ๅณ่พๅบP%1000000007
'''
def inverse_pairs(data):
count, temp = count_sort(data)
return count % 1000000007
def count_sort(data):
if len(data) <= 1:
return 0, data
mid = len(data) // 2
count_left, left = count_sort(data[:mid])
count_right, right = count_sort(data[mid:])
count_two, temp_data = count_merge(left, right)
return count_left + count_right + count_two, temp_data
def count_merge(left, right):
temp = []
i = 0
j = 0
count = 0
while i < len(left) and j < len(right):
if left[i] > right[j]:
count += len(left) - i
temp.append(right[j])
j += 1
else:
temp.append(left[i])
i += 1
while i < len(left):
temp.append(left[i])
i = i + 1
while j < len(right):
temp.append(right[j])
j = j + 1
return count, temp
if __name__ == '__main__':
a = [1,2,3,4,5,6,7,0]
count = inverse_pairs(a)
print(count)
|
kmisiunas/GeoScala
|
src/main/scala/com/misiunas/geoscala/grid/Grid.scala
|
<filename>src/main/scala/com/misiunas/geoscala/grid/Grid.scala<gh_stars>1-10
package com.misiunas.geoscala.grid
import com.misiunas.geoscala.Point
/**
* == Grid on the landscape ==
* User: <EMAIL>
* Date: 21/08/2013
* Time: 14:37
*/
trait Grid[A] {
def apply(p: Point): A
protected def findBin(d: Double* )
}
|
hosomi/LeetCode
|
#0135.candy.cpp
|
<gh_stars>0
class Solution {
public:
int candy(vector<int>& ratings) {
int size = ratings.size();
vector<int> result(size, 1);
for (int i = 1; i < size; ++i) {
if (ratings[i] > ratings[i - 1]) {
result[i] = result[i - 1] + 1;
}
}
int start = size - 2;
for (int i = start; i >= 0; --i) {
if (ratings[i] > ratings[i + 1]) {
result[i] = std::max(result[i], result[i + 1] + 1);
}
}
return std::accumulate(std::begin(result), std::end(result), 0);
}
};
|
luizfilipe/shopping-cart
|
server.js
|
<filename>server.js
import express from 'express'
const app = express()
app.disable('etag')
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', '*')
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept')
next()
})
app.get('/products', (req, res, next) => {
res.status(200)
.json({
products: [
{
id: 1,
name: 'Banana',
price: 10.0,
available: 10
},
{
id: 2,
name: 'Apple',
price: 20.0,
available: 15
},
{
id: 3,
name: 'Orange',
price: 30.0,
available: 8
},
{
id: 4,
name: 'Mango',
price: 15.0,
available: 20
}
]
})
.end(next)
})
app.get('/vouchers', (req, res, next) => {
res
.status(200)
.json({
vouchers: [
{
id: 1,
code: '#30OFF',
type: 'percentual',
amount: 30.0
},
{
id: 2,
code: '#100DOLLARS',
type: 'fixed',
amount: 100.0
},
{
id: 3,
code: '#SHIPIT',
type: 'shipping',
amount: 0,
minValue: 300.50
}]
}).end(next)
})
app.listen('3020', err => {
if (err) {
console.error(err)
throw err
}
console.warn(`> Ready on port 3020...`)
})
|
benety/mongo
|
jstests/noPassthrough/do_not_drop_coll_after_succesful_out.js
|
<reponame>benety/mongo
// Confirms that there's no attempt to drop a temp collection after $out is performed.
(function() {
"use strict";
// Prevent the mongo shell from gossiping its cluster time, since this will increase the amount
// of data logged for each op.
TestData.skipGossipingClusterTime = true;
const conn = MongoRunner.runMongod();
assert.neq(null, conn, "mongod was unable to start up");
const testDB = conn.getDB("test");
const coll = testDB.do_not_drop_coll_after_succesful_out;
assert.commandWorked(coll.insert({a: 1}));
assert.commandWorked(testDB.setLogLevel(2, "command"));
assert.commandWorked(testDB.adminCommand({clearLog: "global"}));
coll.aggregate([{$out: coll.getName() + "_out"}]);
const log = assert.commandWorked(testDB.adminCommand({getLog: "global"})).log;
for (let i = 0; i < log.length; ++i) {
const line = log[i];
assert.eq(line.indexOf("drop test.tmp.agg_out"), -1, line);
}
MongoRunner.stopMongod(conn);
})();
|
Jia-shuaitao/esa-restlight
|
restlight-server/src/test/java/esa/restlight/server/schedule/TimeoutSchedulerTest.java
|
<filename>restlight-server/src/test/java/esa/restlight/server/schedule/TimeoutSchedulerTest.java
/*
* Copyright 2021 OPPO ESA Stack Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package esa.restlight.server.schedule;
import esa.httpserver.core.AsyncResponse;
import esa.restlight.server.config.TimeoutOptionsConfigure;
import esa.restlight.test.mock.MockAsyncRequest;
import esa.restlight.test.mock.MockAsyncResponse;
import org.junit.jupiter.api.Test;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
class TimeoutSchedulerTest {
@Test
void testDelegate() {
final Scheduler delegate = mock(Scheduler.class);
final TimeoutScheduler scheduler = new TimeoutScheduler(delegate, TimeoutOptionsConfigure.defaultOpts());
scheduler.name();
verify(delegate).name();
scheduler.shutdown();
verify(delegate).shutdown();
final Runnable runnable = () -> {};
scheduler.schedule(runnable);
verify(delegate).schedule(runnable);
}
@Test
void testRejectedBeforeExecution() {
final AtomicBoolean flag = new AtomicBoolean();
// actualCost < timeoutMillis
final TimeoutScheduler scheduler0 = new TimeoutScheduler(Schedulers.io(),
TimeoutOptionsConfigure.newOpts().timeMillis(5L).configured());
final AsyncResponse response0 = MockAsyncResponse.aMockResponse().build();
final Runnable runnable0 = () -> {
flag.set(true);
response0.sendResult(1000);
};
final RequestTask task0 = RequestTaskImpl.newRequestTask(MockAsyncRequest.aMockRequest().build(),
response0, new CompletableFuture<>(), runnable0);
scheduler0.schedule(task0);
assertTrue(flag.get());
assertEquals(1000, response0.status());
flag.set(false);
// actualCost >= timeoutMillis
final AsyncResponse response1 = MockAsyncResponse.aMockResponse().build();
final Runnable runnable1 = () -> {
response1.sendResult(1000);
flag.set(true);
};
final RequestTask task1 = RequestTaskImpl.newRequestTask(MockAsyncRequest.aMockRequest().build(),
MockAsyncResponse.aMockResponse().build(), new CompletableFuture<>(), runnable1);
final TimeoutScheduler scheduler1 = new TimeoutScheduler(new Scheduler() {
@Override
public String name() {
return "test";
}
@Override
public void schedule(Runnable cmd) {
try {
TimeUnit.MILLISECONDS.sleep(10L);
} catch (Throwable ignore) {
}
cmd.run();
}
@Override
public void shutdown() {
}
}, TimeoutOptionsConfigure.newOpts().timeMillis(5L).configured());
scheduler1.schedule(task1);
assertFalse(flag.get());
assertEquals(200, response1.status());
}
}
|
dieterpl/JAGE
|
src/main/java/JAGE/GUI/MainView/MainView.java
|
<gh_stars>0
/*
* Copyright 2020 <NAME>
* All rights reserved.
*/
package JAGE.GUI.MainView;
import JAGE.display.FrameBuffer;
import JAGE.display.GPU;
import javafx.animation.AnimationTimer;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import java.io.IOException;
/**
* Main Window containing the display rendering the game
*/
public class MainView extends Stage implements EventHandler<WindowEvent> {
Scene scene;
public MainView() throws IOException {
this.setOnCloseRequest(this);
Parent mainWindow = FXMLLoader.load(getClass().getClassLoader().getResource("mainWindow.fxml"));
scene = new Scene(mainWindow);
this.setTitle("Main");
this.setScene(scene);
this.createCanvas();
this.setResizable(false);
this.show();
}
@Override
public void handle(WindowEvent event) {
System.exit(0);
}
private Canvas createCanvas() {
Canvas canvas = (Canvas) scene.lookup("#canvas");
double canvasWidth = canvas.getWidth();
double canvasHeight = canvas.getHeight();
GraphicsContext gc = canvas.getGraphicsContext2D();
new AnimationTimer() {
long lastTime = System.nanoTime();
public void handle(long currentNanoTime) {
try {
GPU.getInstance().updateBackgroundTiles();
} catch (Exception e) {
e.printStackTrace();
return;
}
for (int x = 0; x < FrameBuffer.width; x++) {
for (int y = 0; y < FrameBuffer.height; y++) {
try {
gc.getPixelWriter().setColor(x, y, FrameBuffer.getInstance().getPixel(x, y));
} catch (Exception e) {
e.printStackTrace();
}
}
}
String fps = String.valueOf(Math.round(1000000000.0 / (currentNanoTime - lastTime)));
gc.fillText(fps, 0, 10);
gc.strokeText(fps, 0, 10);
lastTime = currentNanoTime;
}
}.start();
return canvas;
}
}
|
juanpernu/BilogWeb
|
pages/faqs.js
|
<reponame>juanpernu/BilogWeb
import Layout from '../components/Layout';
import Cover from '../components/Cover/Cover';
import Accordion from '../components/Faq';
import { faqs } from "../mocks/faqs";
export default () => (
<Layout>
<Cover
text="Preguntas frecuentes"
paragraph="Te dejamos a mano las preguntas mรกs frecuentes con sus respectivas respuestas. En caso de no encontrar la pregunta o respuesta que estรกs buscando, no dudes en llamarnos!"
hasButtons={false}
/>
<Accordion data={faqs} />
</Layout>
);
|
roivaz/marin3r
|
pkg/reconcilers/operator/discoveryservice/generators/service_account_test.go
|
package generators
import (
"testing"
"time"
operatorv1alpha1 "github.com/3scale-ops/marin3r/apis/operator.marin3r/v1alpha1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
)
func TestGeneratorOptions_ServiceAccount(t *testing.T) {
type args struct {
hash string
}
tests := []struct {
name string
opts GeneratorOptions
args args
want client.Object
}{
{"Generates a ServiceAccount",
GeneratorOptions{
InstanceName: "test",
Namespace: "default",
RootCertificateNamePrefix: "ca-cert",
RootCertificateCommonNamePrefix: "test",
RootCertificateDuration: time.Duration(10 * time.Second), // 3 years
ServerCertificateNamePrefix: "server-cert",
ServerCertificateCommonNamePrefix: "test",
ServerCertificateDuration: time.Duration(10 * time.Second), // 90 days,
ClientCertificateDuration: time.Duration(10 * time.Second),
XdsServerPort: 1000,
MetricsServerPort: 1001,
ServiceType: operatorv1alpha1.ClusterIPType,
DeploymentImage: "test:latest",
DeploymentResources: corev1.ResourceRequirements{},
Debug: true,
},
args{hash: "hash"},
&corev1.ServiceAccount{
TypeMeta: metav1.TypeMeta{
Kind: "ServiceAccount",
APIVersion: corev1.SchemeGroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: "marin3r-test",
Namespace: "default",
Labels: map[string]string{
"app.kubernetes.io/name": "marin3r",
"app.kubernetes.io/managed-by": "marin3r-operator",
"app.kubernetes.io/component": "discovery-service",
"app.kubernetes.io/instance": "test",
}},
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
cfg := tt.opts
if got := cfg.ServiceAccount()(); !equality.Semantic.DeepEqual(got, tt.want) {
t.Errorf("GeneratorOptions.ServiceAccount() = %v, want %v", got, tt.want)
}
})
}
}
|
fossabot/arctic
|
engine/rgb.h
|
<filename>engine/rgb.h
// The MIT License(MIT)
//
// Copyright 2017 Huldra
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions :
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
#ifndef ENGINE_RGB_H_
#define ENGINE_RGB_H_
#include "engine/arctic_types.h"
namespace arctic {
struct Rgb {
union {
struct {
Ui8 r;
Ui8 g;
Ui8 b;
};
Ui8 element[3];
};
Rgb() {}
explicit Rgb(Ui8 r_in, Ui8 g_in, Ui8 b_in) {
r = r_in;
g = g_in;
b = b_in;
}
explicit Rgb(Ui8 s) {
r = s;
g = s;
b = s;
}
explicit Rgb(Ui32 rgb_in) {
r = rgb_in & 0xff;
g = (rgb_in >> 8) & 0xff;
b = (rgb_in >> 16) & 0xff;
}
Ui8 &operator[](Si32 i) {
return element[i];
}
const Ui8 &operator[](Si32 i) const {
return element[i];
}
Rgb &operator =(const Rgb &v) {
r = v.r;
g = v.g;
b = v.b;
return *this;
}
const bool operator== (const Rgb &v) const {
return r == v.r && g == v.g && b == v.b;
}
const bool operator!= (const Rgb &v) const {
return r != v.r || g != v.g || b != v.b;
}
};
} // namespace arctic
#endif // ENGINE_RGB_H_
|
kevin70/houge
|
houge-server-logic/src/main/java/cool/houge/logic/handler/GroupMessageHandler.java
|
<reponame>kevin70/houge<gh_stars>1-10
/*
* Copyright 2019-2021 the original author or authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cool.houge.logic.handler;
import com.google.common.base.CharMatcher;
import com.google.common.base.Strings;
import cool.houge.BizCodes;
import cool.houge.id.MessageIdGenerator;
import cool.houge.logic.agent.PacketSender;
import cool.houge.logic.handler.internal.MessagePacketHelper;
import cool.houge.logic.packet.MessagePacketBase;
import cool.houge.service.message.MessageStorageService;
import cool.houge.storage.query.GroupQueryDao;
import cool.houge.util.YeinGid;
import java.util.List;
import javax.inject.Inject;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import reactor.core.publisher.Mono;
import top.yein.chaos.biz.StacklessBizCodeException;
/**
* ็พค็ปๆถๆฏๅค็ๅจ.
*
* @author KK (<EMAIL>)
*/
public class GroupMessageHandler implements PacketHandler<MessagePacketBase> {
private static final Logger log = LogManager.getLogger();
private final MessageIdGenerator messageIdGenerator;
private final MessageStorageService messageStorageService;
private final PacketSender packetSender;
private final GroupQueryDao groupQueryDao;
/**
* @param messageIdGenerator
* @param messageStorageService
* @param packetSender
* @param groupQueryDao
*/
@Inject
public GroupMessageHandler(
MessageIdGenerator messageIdGenerator,
MessageStorageService messageStorageService,
PacketSender packetSender,
GroupQueryDao groupQueryDao) {
this.messageIdGenerator = messageIdGenerator;
this.messageStorageService = messageStorageService;
this.packetSender = packetSender;
this.groupQueryDao = groupQueryDao;
}
@Override
public Mono<Void> handle(MessagePacketBase packet) {
if (packet.getMessageId() == null) {
// ่ชๅจๅกซๅ
ๆถๆฏ ID
packet.setMessageId(messageIdGenerator.nextId());
log.debug("่ชๅจๅกซๅ
็พค่ๆถๆฏ ID, packet={}", packet);
}
// ๆ ก้ช message_id
if (packet.getMessageId().length() != YeinGid.YEIN_GID_LENGTH) {
throw new StacklessBizCodeException(BizCodes.C3600, "[message_id]ไธ่ฝไธบ็ฉบไธๅฟ
้กปๆฏไธไธช้ฟๅบฆไธบ 15 ็ๅญ็ฌฆไธฒ");
}
if (CharMatcher.whitespace().matchesAnyOf(packet.getMessageId())) {
throw new StacklessBizCodeException(BizCodes.C3600, "[message_id]ไธ่ฝๅ
ๅซ็ฉบ็ฝๅญ็ฌฆ");
}
var gid = packet.getTo();
return groupQueryDao
.existsById(gid)
.switchIfEmpty(
Mono.error(
() ->
new StacklessBizCodeException(
BizCodes.C3630, Strings.lenientFormat("็พค็ปไธๅญๅจ[gid=%s]", gid))))
.doOnNext(uids -> packetSender.sendToGroup(List.of(gid), packet))
.flatMapMany(unused -> groupQueryDao.queryUidByGid(gid))
.collectList()
.filter(uids -> !uids.isEmpty())
.flatMap(
uids -> {
// ๅญๅจๆถๆฏ
var entity = MessagePacketHelper.toMessageEntity(packet);
return messageStorageService.store(entity, uids);
})
.then();
}
}
|
M10beretta/java
|
src/com/mber/javarush/task/task03/task0303/Solution.java
|
<gh_stars>0
package com.mber.javarush.task.task03.task0303;
/*
ะะฑะผะตะฝ ะฒะฐะปัั
*/
public class Solution {
public static void main(String[] args) {
double usd1 = convertEurToUsd(100, 0.8);
double usd2 = convertEurToUsd(200, 0.8);
System.out.println(usd1);
System.out.println(usd2);
}
public static double convertEurToUsd(int eur, double exchangeRate) {
return eur * exchangeRate;
}
}
|
Nalhin/Leetcode
|
src/main/java/com/leetcode/tree/easy/MaximumDepthOfNaryTree_559.java
|
package com.leetcode.tree.easy;
// Given a n-ary tree, find its maximum depth.
//
// The maximum depth is the number of nodes along the longest path from the root
// node down to the farthest leaf node.
//
// Nary-Tree input serialization is represented in their level order traversal,
// each group of children is separated by the null value (See examples).
//
//
// Example 1:
//
//
//
//
// Input: root = [1,null,3,2,4,null,5,6]
// Output: 3
//
//
// Example 2:
//
//
//
//
// Input: root = [1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null
// ,12,null,13,null,null,14]
// Output: 5
//
//
//
// Constraints:
//
//
// The depth of the n-ary tree is less than or equal to 1000.
// The total number of nodes is between [0, 10^4].
//
// Related Topics Tree Depth-first Search Breadth-first Search
// ๐ 1036 ๐ 50
// leetcode submit region begin(Prohibit modification and deletion)
/*
// Definition for a Node.
class Node {
public int val;
public List<Node> children;
public Node() {}
public Node(int _val) {
val = _val;
}
public Node(int _val, List<Node> _children) {
val = _val;
children = _children;
}
};
*/
import java.util.List;
/*
O(n) Runtime: 0 ms, faster than 100.00% of Java online submissions for Maximum Depth of N-ary Tree.
O(n) Memory Usage: 39.5 MB, less than 7.61% of Java online submissions for Maximum Depth of N-ary Tree.
*/
public class MaximumDepthOfNaryTree_559 {
public int maxDepth(Node root) {
if (root == null) {
return 0;
}
int max = 0;
for (Node n : root.children) {
max = Math.max(maxDepth(n), max);
}
return max + 1;
}
private static class Node {
public int val;
public List<Node> children;
public Node() {}
public Node(int _val) {
val = _val;
}
public Node(int _val, List<Node> _children) {
val = _val;
children = _children;
}
}
}
// leetcode submit region end(Prohibit modification and deletion)
|
paulish/express-jsdoc-swagger
|
test/e2e/errors/jsdoc-parameter-error.js
|
/**
* GET /api/v1/album
* @summary This is the summary of the endpoint
* @param name.query.required - name param description
* @param phone.param - phone number
* @return {string} 200 - success response
*/
|
Omrigan/tgbot-cpp
|
docs/class_tg_bot_1_1_update.js
|
var class_tg_bot_1_1_update =
[
[ "Ptr", "class_tg_bot_1_1_update.html#abace63cf3605fe7a480a3bb839a672a8", null ],
[ "callbackQuery", "class_tg_bot_1_1_update.html#a2c6890adcab16d6a306b3b89fd954f6f", null ],
[ "channelPost", "class_tg_bot_1_1_update.html#aabddc6947fe255f1763802532d34ef2b", null ],
[ "chosenInlineResult", "class_tg_bot_1_1_update.html#aa3fab72bc10111e2f8f8930c43a0ff8b", null ],
[ "editedChannelPost", "class_tg_bot_1_1_update.html#a05588da55717387ef91434f014afff1b", null ],
[ "editedMessage", "class_tg_bot_1_1_update.html#a188502d94515baee85ba30f58cffa1b5", null ],
[ "inlineQuery", "class_tg_bot_1_1_update.html#aea03e36b9015a0fe9f1278564c5b8806", null ],
[ "message", "class_tg_bot_1_1_update.html#ab65136c0345978742fb3026e6855ff2c", null ],
[ "updateId", "class_tg_bot_1_1_update.html#af4d35314c4e49839f7012a9671ede097", null ]
];
|
daveherron/plug-and-trust
|
optee_lib/include/PlugAndTrust_Pkg_Ver.h
|
/* Copyright 2019-2021 NXP
*
* SPDX-License-Identifier: Apache-2.0
*
*
*/
#ifndef PLUGANDTRUST_VERSION_INFO_H_INCLUDED
#define PLUGANDTRUST_VERSION_INFO_H_INCLUDED
/* clang-format off */
#define PLUGANDTRUST_PROD_NAME "PlugAndTrust"
#define PLUGANDTRUST_VER_STRING_NUM "v03.03.00_20210528"
#define PLUGANDTRUST_PROD_NAME_VER_FULL "PlugAndTrust_v03.03.00_20210528"
#define PLUGANDTRUST_VER_MAJOR (3u)
#define PLUGANDTRUST_VER_MINOR (3u)
#define PLUGANDTRUST_VER_DEV (0u)
/* v03.03 = 30003u */
#define PLUGANDTRUST_VER_MAJOR_MINOR ( 0 \
| (PLUGANDTRUST_VER_MAJOR * 10000u) \
| (PLUGANDTRUST_VER_MINOR))
/* v03.03.00 = 300030000ULL */
#define PLUGANDTRUST_VER_MAJOR_MINOR_DEV ( 0 \
| (PLUGANDTRUST_VER_MAJOR * 10000*10000u) \
| (PLUGANDTRUST_VER_MINOR * 10000u) \
| (PLUGANDTRUST_VER_DEV))
/* clang-format on */
/* Version Information:
* Generated by:
* scripts\version_info.py (v2019.01.17_00)
*
* Do not edit this file. Update:
* ./version_info.txt instead.
*
* prod_name = "PlugAndTrust"
*
* prod_desc = "Plug And Trust Package"
*
* lang_c_prefix = prod_name.upper()
*
* lang_namespace = ""
*
* v_major = "03"
*
* v_minor = "03"
*
* v_dev = "00"
*
* # Develop Branch
* v_meta = ""
*
* maturity = "B"
*
*/
#endif /* PLUGANDTRUST_VERSION_INFO_H_INCLUDED */
|
tsmsogn/to_quickform
|
spec/to_quickform/element_factory_spec.rb
|
require "spec_helper"
require "to_quickform/element_factory"
RSpec.describe ToQuickform::ElementFactory do
subject(:factory) { described_class }
describe ".new" do
it "throws error if klass type is ommitted" do
expect { factory.new nil }.to raise_error(ArgumentError)
end
end
it "instantiates a checkbox object" do
checkbox = factory.new({ "type" => "checkbox", "name" => "agree" })
expect(checkbox).to be_a ToQuickform::Element::Checkbox
end
it "instantiates a group object" do
group = factory.new({ "type" => "group", "name" => "postal_code", "element" => [{ "type" => "text" }, { "type" => "text" }] })
expect(group).to be_a ToQuickform::Element::Group
end
it "instantiates a hidden object" do
hidden = factory.new({ "type" => "hidden", "name" => "id", "value" => 1 })
expect(hidden).to be_a ToQuickform::Element::Hidden
end
it "instantiates a password object" do
password = factory.new({ "type" => "password", "name" => "id", "value" => 1 })
expect(password).to be_a ToQuickform::Element::Password
end
it "instantiates a radio object" do
radio = factory.new({ "type" => "radio", "name" => "subscribe" })
expect(radio).to be_a ToQuickform::Element::Radio
end
it "instantiates a reset object" do
reset = factory.new({ "type" => "reset", "name" => "reset_button" })
expect(reset).to be_a ToQuickform::Element::Reset
end
it "instantiates a select object" do
select = factory.new({ "type" => "select", "name" => "car", "value" => { "volvo" => "Volvo", "mercedes" => "Mercedes", "audi" => "Audi" } })
expect(select).to be_a ToQuickform::Element::Select
end
it "instantiates a submit object" do
submit = factory.new({ "type" => "submit", "name" => "submit" })
expect(submit).to be_a ToQuickform::Element::Submit
end
it "instantiates a text object" do
text = factory.new({ "type" => "text", "name" => "first_name" })
expect(text).to be_a ToQuickform::Element::Text
end
it "instantiates a textarea object" do
textarea = factory.new({ "type" => "textarea", "name" => "inquiry" })
expect(textarea).to be_a ToQuickform::Element::Textarea
end
end
|
cau-se/oceandsl-tools
|
tools/maa/src/test/java/org/oceandsl/tools/maa/stages/TestModelInvocationUtils.java
|
<reponame>cau-se/oceandsl-tools<gh_stars>1-10
/***************************************************************************
* Copyright (C) 2021 OceanDSL (https://oceandsl.uni-kiel.de)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
package org.oceandsl.tools.maa.stages;
import kieker.analysis.stage.model.ModelRepository;
import kieker.model.analysismodel.assembly.AssemblyComponent;
import kieker.model.analysismodel.assembly.AssemblyFactory;
import kieker.model.analysismodel.assembly.AssemblyModel;
import kieker.model.analysismodel.assembly.AssemblyProvidedInterface;
import kieker.model.analysismodel.deployment.DeployedComponent;
import kieker.model.analysismodel.deployment.DeployedOperation;
import kieker.model.analysismodel.deployment.DeployedProvidedInterface;
import kieker.model.analysismodel.deployment.DeploymentContext;
import kieker.model.analysismodel.deployment.DeploymentFactory;
import kieker.model.analysismodel.deployment.DeploymentModel;
import kieker.model.analysismodel.execution.AggregatedInvocation;
import kieker.model.analysismodel.execution.ExecutionFactory;
import kieker.model.analysismodel.execution.ExecutionModel;
import kieker.model.analysismodel.execution.Tuple;
import kieker.model.analysismodel.type.ComponentType;
import kieker.model.analysismodel.type.OperationType;
import kieker.model.analysismodel.type.ProvidedInterfaceType;
import kieker.model.analysismodel.type.TypeFactory;
import kieker.model.analysismodel.type.TypeModel;
/**
* @author <NAME>
*
*/
public final class TestModelInvocationUtils {
private TestModelInvocationUtils() {
// utility class
}
public static void addInvocations(final ModelRepository modelRepository) {
final DeploymentModel deploymentModel = modelRepository.getModel(DeploymentModel.class);
modelRepository.register(ExecutionModel.class, TestModelInvocationUtils.createExecutions(deploymentModel));
}
private static ExecutionModel createExecutions(final DeploymentModel deploymentModel) {
final ExecutionModel executionModel = ExecutionFactory.eINSTANCE.createExecutionModel();
final DeploymentContext context = deploymentModel.getDeploymentContexts()
.get(TestModelRepositoryUtils.CONTEXT_A);
final DeployedComponent componentA = context.getComponents()
.get(TestModelRepositoryUtils.FQN_COMPONENT_A + ":1");
final DeployedComponent componentB = context.getComponents()
.get(TestModelRepositoryUtils.FQN_COMPONENT_B + ":1");
final DeployedComponent componentC = context.getComponents()
.get(TestModelRepositoryUtils.FQN_COMPONENT_C + ":1");
final DeployedOperation opAMain = componentA.getOperations()
.get(TestModelRepositoryUtils.OP_A_NAME_MAIN_SIGNATURE);
final DeployedOperation opASecond = componentA.getOperations()
.get(TestModelRepositoryUtils.OP_A_NAME_SECOND_SIGNATURE);
final DeployedOperation opB = componentB.getOperations().get(TestModelRepositoryUtils.OP_B_NAME_SIGNATURE);
final DeployedOperation opC = componentC.getOperations().get(TestModelRepositoryUtils.OP_C_NAME_SIGNATURE);
TestModelInvocationUtils.createInvocation(executionModel, opAMain, opASecond);
TestModelInvocationUtils.createInvocation(executionModel, opASecond, opB);
TestModelInvocationUtils.createInvocation(executionModel, opB, opC);
return executionModel;
}
private static void createInvocation(final ExecutionModel executionModel, final DeployedOperation caller,
final DeployedOperation callee) {
final Tuple<DeployedOperation, DeployedOperation> key = ExecutionFactory.eINSTANCE.createTuple();
key.setFirst(caller);
key.setSecond(callee);
final AggregatedInvocation value = ExecutionFactory.eINSTANCE.createAggregatedInvocation();
value.setSource(caller);
value.setTarget(callee);
executionModel.getAggregatedInvocations().put(key, value);
}
public static void addProvidedInterfaces(final ModelRepository modelRepository) {
TestModelInvocationUtils.createProvidedInterface(modelRepository, TestModelRepositoryUtils.FQN_COMPONENT_B,
TestModelRepositoryUtils.OP_B_NAME_SIGNATURE);
TestModelInvocationUtils.createProvidedInterface(modelRepository, TestModelRepositoryUtils.FQN_COMPONENT_C,
TestModelRepositoryUtils.OP_C_NAME_SIGNATURE);
}
public static void addEmptyProvidedInterfaces(final ModelRepository modelRepository) {
TestModelInvocationUtils.createEmptyProvidedInterface(modelRepository,
TestModelRepositoryUtils.FQN_COMPONENT_B);
TestModelInvocationUtils.createEmptyProvidedInterface(modelRepository,
TestModelRepositoryUtils.FQN_COMPONENT_C);
}
private static void createEmptyProvidedInterface(final ModelRepository modelRepository,
final String componentName) {
final TypeModel typeModel = modelRepository.getModel(TypeModel.class);
final AssemblyModel assmeblyModel = modelRepository.getModel(AssemblyModel.class);
final DeploymentModel deploymentModel = modelRepository.getModel(DeploymentModel.class);
final ComponentType componentType = typeModel.getComponentTypes().get(componentName);
final AssemblyComponent assemblyComponent = assmeblyModel.getAssemblyComponents().get(componentName + ":1");
final DeployedComponent deployedComponent = deploymentModel.getDeploymentContexts()
.get(TestModelRepositoryUtils.CONTEXT_A).getComponents().get(componentName + ":1");
final ProvidedInterfaceType providedInterfaceType = TestModelInvocationUtils
.createProvidedInterfaceType(componentType);
final AssemblyProvidedInterface assemblyProvidedInterface = TestModelInvocationUtils
.createAssemblyProvidedInterface(assemblyComponent, providedInterfaceType);
TestModelInvocationUtils.createDeployedProvidedInterface(deployedComponent, assemblyProvidedInterface);
}
private static void createProvidedInterface(final ModelRepository modelRepository, final String componentName,
final String operationName) {
final TypeModel typeModel = modelRepository.getModel(TypeModel.class);
final AssemblyModel assmeblyModel = modelRepository.getModel(AssemblyModel.class);
final DeploymentModel deploymentModel = modelRepository.getModel(DeploymentModel.class);
final ComponentType componentType = typeModel.getComponentTypes().get(componentName);
final AssemblyComponent assemblyComponent = assmeblyModel.getAssemblyComponents().get(componentName + ":1");
final DeployedComponent deployedComponent = deploymentModel.getDeploymentContexts()
.get(TestModelRepositoryUtils.CONTEXT_A).getComponents().get(componentName + ":1");
final ProvidedInterfaceType providedInterfaceType = TestModelInvocationUtils
.createProvidedInterfaceType(componentType, operationName);
final AssemblyProvidedInterface assemblyProvidedInterface = TestModelInvocationUtils
.createAssemblyProvidedInterface(assemblyComponent, providedInterfaceType, operationName);
TestModelInvocationUtils.createDeployedProvidedInterface(deployedComponent, assemblyProvidedInterface);
}
private static DeployedProvidedInterface createDeployedProvidedInterface(final DeployedComponent deployedComponent,
final AssemblyProvidedInterface assemblyProvidedInterface) {
final DeployedProvidedInterface deployedProvidedInterface = DeploymentFactory.eINSTANCE
.createDeployedProvidedInterface();
deployedProvidedInterface.setProvidedInterface(assemblyProvidedInterface);
deployedComponent.getProvidedInterfaces().put(
deployedProvidedInterface.getProvidedInterface().getProvidedInterfaceType().getSignature(),
deployedProvidedInterface);
return deployedProvidedInterface;
}
private static AssemblyProvidedInterface createAssemblyProvidedInterface(final AssemblyComponent assemblyComponent,
final ProvidedInterfaceType providedInterfaceType, final String operationSignature) {
final AssemblyProvidedInterface assemblyProvidedInterface = TestModelInvocationUtils
.createAssemblyProvidedInterface(assemblyComponent, providedInterfaceType);
return assemblyProvidedInterface;
}
private static AssemblyProvidedInterface createAssemblyProvidedInterface(final AssemblyComponent assemblyComponent,
final ProvidedInterfaceType providedInterfaceType) {
final AssemblyProvidedInterface assemblyProvidedInterface = AssemblyFactory.eINSTANCE
.createAssemblyProvidedInterface();
assemblyProvidedInterface.setProvidedInterfaceType(providedInterfaceType);
assemblyComponent.getProvidedInterfaces().put(providedInterfaceType.getSignature(), assemblyProvidedInterface);
return assemblyProvidedInterface;
}
private static ProvidedInterfaceType createProvidedInterfaceType(final ComponentType componentType,
final String operationSignature) {
final ProvidedInterfaceType providedInterfaceType = TestModelInvocationUtils
.createProvidedInterfaceType(componentType);
final OperationType operation = componentType.getProvidedOperations().get(operationSignature);
providedInterfaceType.getProvidedOperationTypes().put(operationSignature, operation);
return providedInterfaceType;
}
private static ProvidedInterfaceType createProvidedInterfaceType(final ComponentType componentType) {
final ProvidedInterfaceType providedInterfaceType = TypeFactory.eINSTANCE.createProvidedInterfaceType();
providedInterfaceType
.setSignature(componentType.getSignature() + componentType.getProvidedInterfaceTypes().size());
providedInterfaceType.setPackage(componentType.getPackage());
providedInterfaceType.setName(componentType.getName() + componentType.getProvidedInterfaceTypes().size());
componentType.getProvidedInterfaceTypes().add(providedInterfaceType);
return providedInterfaceType;
}
}
|
RobotLocomotion/drake-python3.7
|
solvers/constraint.h
|
#pragma once
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include <Eigen/Core>
#include <Eigen/SparseCore>
#include "drake/common/drake_assert.h"
#include "drake/common/drake_copyable.h"
#include "drake/common/eigen_types.h"
#include "drake/common/polynomial.h"
#include "drake/common/symbolic.h"
#include "drake/solvers/decision_variable.h"
#include "drake/solvers/evaluator_base.h"
#include "drake/solvers/function.h"
namespace drake {
namespace solvers {
// TODO(eric.cousineau): Consider enabling the constraint class directly to
// specify new slack variables.
// TODO(eric.cousineau): Consider parameterized constraints: e.g. the
// acceleration constraints in the rigid body dynamics are constraints
// on vdot and f, but are "parameterized" by q and v.
/**
* A constraint is a function + lower and upper bounds.
*
* Solver interfaces must acknowledge that these constraints are mutable.
* Parameters can change after the constraint is constructed and before the
* call to Solve().
*
* It should support evaluating the constraint, and adding it to an optimization
* problem.
*
* @ingroup solver_evaluators
*/
class Constraint : public EvaluatorBase {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(Constraint)
/**
* Constructs a constraint which has `num_constraints` rows, with an input
* `num_vars` x 1 vector.
* @param num_constraints. The number of rows in the constraint output.
* @param num_vars. The number of rows in the input.
* If the input dimension is unknown, then set `num_vars` to Eigen::Dynamic.
* @param lb Lower bound, which must be a `num_constraints` x 1 vector.
* @param ub Upper bound, which must be a `num_constraints` x 1 vector.
* @see Eval(...)
*/
template <typename DerivedLB, typename DerivedUB>
Constraint(int num_constraints, int num_vars,
const Eigen::MatrixBase<DerivedLB>& lb,
const Eigen::MatrixBase<DerivedUB>& ub,
const std::string& description = "")
: EvaluatorBase(num_constraints, num_vars, description),
lower_bound_(lb),
upper_bound_(ub) {
check(num_constraints);
}
/**
* Constructs a constraint which has `num_constraints` rows, with an input
* `num_vars` x 1 vector, with no bounds.
* @param num_constraints. The number of rows in the constraint output.
* @param num_vars. The number of rows in the input.
* If the input dimension is unknown, then set `num_vars` to Eigen::Dynamic.
* @see Eval(...)
*/
Constraint(int num_constraints, int num_vars)
: Constraint(
num_constraints, num_vars,
Eigen::VectorXd::Constant(num_constraints,
-std::numeric_limits<double>::infinity()),
Eigen::VectorXd::Constant(
num_constraints, std::numeric_limits<double>::infinity())) {}
/**
* Return whether this constraint is satisfied by the given value, `x`.
* @param x A `num_vars` x 1 vector.
* @param tol A tolerance for bound checking.
*/
bool CheckSatisfied(const Eigen::Ref<const Eigen::VectorXd>& x,
double tol = 1E-6) const {
DRAKE_ASSERT(x.rows() == num_vars() || num_vars() == Eigen::Dynamic);
return DoCheckSatisfied(x, tol);
}
bool CheckSatisfied(const Eigen::Ref<const AutoDiffVecXd>& x,
double tol = 1E-6) const {
DRAKE_ASSERT(x.rows() == num_vars() || num_vars() == Eigen::Dynamic);
return DoCheckSatisfied(x, tol);
}
symbolic::Formula CheckSatisfied(
const Eigen::Ref<const VectorX<symbolic::Variable>>& x) const {
DRAKE_ASSERT(x.rows() == num_vars() || num_vars() == Eigen::Dynamic);
return DoCheckSatisfied(x);
}
const Eigen::VectorXd& lower_bound() const { return lower_bound_; }
const Eigen::VectorXd& upper_bound() const { return upper_bound_; }
/** Number of rows in the output constraint. */
int num_constraints() const { return num_outputs(); }
protected:
/** Updates the lower bound.
* @note if the users want to expose this method in a sub-class, do
* using Constraint::UpdateLowerBound, as in LinearConstraint.
*/
void UpdateLowerBound(const Eigen::Ref<const Eigen::VectorXd>& new_lb) {
if (new_lb.rows() != num_constraints()) {
throw std::logic_error("Lower bound has invalid dimension.");
}
lower_bound_ = new_lb;
}
/** Updates the upper bound.
* @note if the users want to expose this method in a sub-class, do
* using Constraint::UpdateUpperBound, as in LinearConstraint.
*/
void UpdateUpperBound(const Eigen::Ref<const Eigen::VectorXd>& new_ub) {
if (new_ub.rows() != num_constraints()) {
throw std::logic_error("Upper bound has invalid dimension.");
}
upper_bound_ = new_ub;
}
/**
* Set the upper and lower bounds of the constraint.
* @param lower_bound. A `num_constraints` x 1 vector.
* @param upper_bound. A `num_constraints` x 1 vector.
* @note If the users want to expose this method in a sub-class, do
* using Constraint::set_bounds, as in LinearConstraint.
*/
void set_bounds(const Eigen::Ref<const Eigen::VectorXd>& lower_bound,
const Eigen::Ref<const Eigen::VectorXd>& upper_bound) {
UpdateLowerBound(lower_bound);
UpdateUpperBound(upper_bound);
}
virtual bool DoCheckSatisfied(const Eigen::Ref<const Eigen::VectorXd>& x,
const double tol) const {
Eigen::VectorXd y(num_constraints());
DoEval(x, &y);
return (y.array() >= lower_bound_.array() - tol).all() &&
(y.array() <= upper_bound_.array() + tol).all();
}
virtual bool DoCheckSatisfied(const Eigen::Ref<const AutoDiffVecXd>& x,
const double tol) const {
AutoDiffVecXd y(num_constraints());
DoEval(x, &y);
auto get_value = [](const AutoDiffXd& v) { return v.value(); };
return
(y.array().unaryExpr(get_value) >= lower_bound_.array() - tol).all() &&
(y.array().unaryExpr(get_value) <= upper_bound_.array() + tol).all();
}
virtual symbolic::Formula DoCheckSatisfied(
const Eigen::Ref<const VectorX<symbolic::Variable>>& x) const;
private:
void check(int num_constraints) const;
Eigen::VectorXd lower_bound_;
Eigen::VectorXd upper_bound_;
};
/**
* lb โค .5 xแตQx + bแตx โค ub
* Without loss of generality, the class stores a symmetric matrix Q.
* For a non-symmetric matrix Qโ, we can define Q = (Qโ + Qโแต) / 2, since
* xแตQโx = xแตQโแตx = xแต*(Qโ+Qโแต)/2 *x. The first equality holds because the
* transpose of a scalar is the scalar itself. Hence we can always convert
* a non-symmetric matrix Qโ to a symmetric matrix Q.
*/
class QuadraticConstraint : public Constraint {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(QuadraticConstraint)
static const int kNumConstraints = 1;
/**
* Construct a quadratic constraint.
* @tparam DerivedQ The type for Q.
* @tparam Derivedb The type for b.
* @param Q0 The square matrix. Notice that Qโ does not have to be symmetric.
* @param b The linear coefficient.
* @param lb The lower bound.
* @param ub The upper bound.
*/
template <typename DerivedQ, typename Derivedb>
QuadraticConstraint(const Eigen::MatrixBase<DerivedQ>& Q0,
const Eigen::MatrixBase<Derivedb>& b, double lb,
double ub)
: Constraint(kNumConstraints, Q0.rows(), drake::Vector1d::Constant(lb),
drake::Vector1d::Constant(ub)),
Q_((Q0 + Q0.transpose()) / 2),
b_(b) {
DRAKE_ASSERT(Q_.rows() == Q_.cols());
DRAKE_ASSERT(Q_.cols() == b_.rows());
}
~QuadraticConstraint() override {}
/** The symmetric matrix Q, being the Hessian of this constraint.
*/
virtual const Eigen::MatrixXd& Q() const { return Q_; }
virtual const Eigen::VectorXd& b() const { return b_; }
/**
* Updates the quadratic and linear term of the constraint. The new
* matrices need to have the same dimension as before.
* @param new_Q new quadratic term
* @param new_b new linear term
*/
template <typename DerivedQ, typename DerivedB>
void UpdateCoefficients(const Eigen::MatrixBase<DerivedQ>& new_Q,
const Eigen::MatrixBase<DerivedB>& new_b) {
if (new_Q.rows() != new_Q.cols() || new_Q.rows() != new_b.rows() ||
new_b.cols() != 1) {
throw std::runtime_error("New constraints have invalid dimensions");
}
if (new_b.rows() != b_.rows()) {
throw std::runtime_error("Can't change the number of decision variables");
}
Q_ = (new_Q + new_Q.transpose()) / 2;
b_ = new_b;
}
private:
template <typename DerivedX, typename ScalarY>
void DoEvalGeneric(const Eigen::MatrixBase<DerivedX>& x,
VectorX<ScalarY>* y) const;
void DoEval(const Eigen::Ref<const Eigen::VectorXd>& x,
Eigen::VectorXd* y) const override;
void DoEval(const Eigen::Ref<const AutoDiffVecXd>& x,
AutoDiffVecXd* y) const override;
void DoEval(const Eigen::Ref<const VectorX<symbolic::Variable>>& x,
VectorX<symbolic::Expression>* y) const override;
std::ostream& DoDisplay(std::ostream&,
const VectorX<symbolic::Variable>&) const override;
Eigen::MatrixXd Q_;
Eigen::VectorXd b_;
};
/**
Constraining the linear expression \f$ z=Ax+b \f$ lies within the Lorentz cone.
A vector z โ โ โฟ lies within Lorentz cone if
@f[
z_0 \ge \sqrt{z_1^2+...+z_{n-1}^2}
@f]
<!-->
zโ โฅ sqrt(zโยฒ + ... + zโโโยฒ)
<-->
where A โ โ โฟหฃแต, b โ โ โฟ are given matrices.
Ideally this constraint should be handled by a second-order cone solver.
In case the user wants to enforce this constraint through general nonlinear
optimization, we provide three different formulations on the Lorentz cone
constraint
1. g(z) = zโ - sqrt(zโยฒ + ... + zโโโยฒ) โฅ 0
This formulation is not differentiable at zโ=...=zโโโ=0
2. g(z) = zโ - sqrt(zโยฒ + ... + zโโโยฒ) โฅ 0
but the gradient of g(z) is approximated as
โg(z)/โz = [1, -zโ/sqrt(zโยฒ + ... zโโโยฒ + ฮต), ...,
-zโโโ/sqrt(zโยฒ+...+zโโโยฒ+ฮต)] where ฮต is a small positive number.
3. zโยฒ-(zโยฒ+...+zโโโยฒ) โฅ 0
zโ โฅ 0
This constraint is differentiable everywhere, but zโยฒ-(zโยฒ+...+zโโโยฒ) โฅ 0 is
non-convex. The default is to use the first formulation. For more information
and visualization, please refer to
https://inst.eecs.berkeley.edu/~ee127a/book/login/l_socp_soc.html
*/
class LorentzConeConstraint : public Constraint {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(LorentzConeConstraint)
/**
* We provide three possible Eval functions to represent the Lorentz cone
* constraint zโ โฅ sqrt(zโยฒ + ... + zโโโยฒ). For more explanation on the three
* formulations, refer to LorentzConeConstraint documentation.
*/
enum class EvalType {
kConvex, ///< The constraint is g(z) = zโ - sqrt(zโยฒ + ... + zโโโยฒ) โฅ 0
kConvexSmooth, ///< Same as kConvex1, but with approximated gradient.
kNonconvex ///< Nonconvex constraint zโยฒ-(zโยฒ+...+zโโโยฒ) โฅ 0 and zโ โฅ 0
};
LorentzConeConstraint(const Eigen::Ref<const Eigen::MatrixXd>& A,
const Eigen::Ref<const Eigen::VectorXd>& b,
EvalType eval_type = EvalType::kConvex);
~LorentzConeConstraint() override {}
/** Getter for A. */
const Eigen::SparseMatrix<double>& A() const { return A_; }
/** Getter for dense version of A. */
const Eigen::MatrixXd& A_dense() const { return A_dense_; }
/** Getter for b. */
const Eigen::VectorXd& b() const { return b_; }
private:
template <typename DerivedX, typename ScalarY>
void DoEvalGeneric(const Eigen::MatrixBase<DerivedX>& x,
VectorX<ScalarY>* y) const;
void DoEval(const Eigen::Ref<const Eigen::VectorXd>& x,
Eigen::VectorXd* y) const override;
void DoEval(const Eigen::Ref<const AutoDiffVecXd>& x,
AutoDiffVecXd* y) const override;
void DoEval(const Eigen::Ref<const VectorX<symbolic::Variable>>& x,
VectorX<symbolic::Expression>* y) const override;
const Eigen::SparseMatrix<double> A_;
// We need to store a dense matrix of A_, so that we can compute the gradient
// using AutoDiffXd, and return the gradient as a dense matrix.
const Eigen::MatrixXd A_dense_;
const Eigen::VectorXd b_;
const EvalType eval_type_;
};
/**
* Constraining that the linear expression \f$ z=Ax+b \f$ lies within rotated
* Lorentz cone.
* A vector z โ โ โฟ lies within rotated Lorentz cone, if
* @f[
* z_0 \ge 0\\
* z_1 \ge 0\\
* z_0 z_1 \ge z_2^2 + z_3^2 + ... + z_{n-1}^2
* @f]
* where A โ โ โฟหฃแต, b โ โ โฟ are given matrices.
* <!-->
* zโ โฅ 0
* zโ โฅ 0
* zโ * zโ โฅ zโยฒ + zโยฒ + ... zโโโยฒ
* <-->
* For more information and visualization, please refer to
* https://inst.eecs.berkeley.edu/~ee127a/book/login/l_socp_soc.html
*/
class RotatedLorentzConeConstraint : public Constraint {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(RotatedLorentzConeConstraint)
RotatedLorentzConeConstraint(const Eigen::Ref<const Eigen::MatrixXd>& A,
const Eigen::Ref<const Eigen::VectorXd>& b)
: Constraint(
3, A.cols(), Eigen::Vector3d::Constant(0.0),
Eigen::Vector3d::Constant(std::numeric_limits<double>::infinity())),
A_(A.sparseView()),
A_dense_(A),
b_(b) {
DRAKE_DEMAND(A_.rows() >= 3);
DRAKE_ASSERT(A_.rows() == b_.rows());
}
/** Getter for A. */
const Eigen::SparseMatrix<double>& A() const { return A_; }
/** Getter for dense version of A. */
const Eigen::MatrixXd& A_dense() const { return A_dense_; }
/** Getter for b. */
const Eigen::VectorXd& b() const { return b_; }
~RotatedLorentzConeConstraint() override {}
private:
template <typename DerivedX, typename ScalarY>
void DoEvalGeneric(const Eigen::MatrixBase<DerivedX>& x,
VectorX<ScalarY>* y) const;
void DoEval(const Eigen::Ref<const Eigen::VectorXd>& x,
Eigen::VectorXd* y) const override;
void DoEval(const Eigen::Ref<const AutoDiffVecXd>& x,
AutoDiffVecXd* y) const override;
void DoEval(const Eigen::Ref<const VectorX<symbolic::Variable>>& x,
VectorX<symbolic::Expression>* y) const override;
const Eigen::SparseMatrix<double> A_;
// We need to store a dense matrix of A_, so that we can compute the gradient
// using AutoDiffXd, and return the gradient as a dense matrix.
const Eigen::MatrixXd A_dense_;
const Eigen::VectorXd b_;
};
/**
* A constraint that may be specified using another (potentially nonlinear)
* evaluator.
* @tparam EvaluatorType The nested evaluator.
*/
template <typename EvaluatorType = EvaluatorBase>
class EvaluatorConstraint : public Constraint {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(EvaluatorConstraint)
/**
* Constructs an evaluator constraint, given the EvaluatorType instance
* (which will specify the number of constraints and variables), and will
* forward the remaining arguments to the Constraint constructor.
* @param evaluator EvaluatorType instance.
* @param args Arguments to be forwarded to the constraint constructor.
*/
template <typename... Args>
EvaluatorConstraint(const std::shared_ptr<EvaluatorType>& evaluator,
Args&&... args)
: Constraint(evaluator->num_outputs(), evaluator->num_vars(),
std::forward<Args>(args)...),
evaluator_(evaluator) {}
using Constraint::set_bounds;
using Constraint::UpdateLowerBound;
using Constraint::UpdateUpperBound;
protected:
/** Reference to the nested evaluator. */
const EvaluatorType& evaluator() const { return *evaluator_; }
private:
void DoEval(const Eigen::Ref<const Eigen::VectorXd>& x,
Eigen::VectorXd* y) const override {
evaluator_->Eval(x, y);
}
void DoEval(const Eigen::Ref<const AutoDiffVecXd>& x,
AutoDiffVecXd* y) const override {
evaluator_->Eval(x, y);
}
void DoEval(const Eigen::Ref<const VectorX<symbolic::Variable>>& x,
VectorX<symbolic::Expression>* y) const override {
evaluator_->Eval(x, y);
}
std::shared_ptr<EvaluatorType> evaluator_;
};
/**
* A constraint on the values of multivariate polynomials.
*
* lb[i] <= P[i](x, y...) <= ub[i], where each P[i] is a multivariate
* polynomial in x, y...
*
* The Polynomial class uses a different variable naming scheme; thus the
* caller must provide a list of Polynomial::VarType variables that correspond
* to the members of the MathematicalProgram::Binding (the individual scalar
* elements of the given VariableList).
*/
class PolynomialConstraint : public EvaluatorConstraint<PolynomialEvaluator> {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(PolynomialConstraint)
/**
* Constructs a polynomial constraint
* @param polynomials Polynomial vector, a `num_constraints` x 1 vector.
* @param poly_vars Polynomial variables, a `num_vars` x 1 vector.
* @param lb Lower bounds, a `num_constraints` x 1 vector.
* @param ub Upper bounds, a `num_constraints` x 1 vector.
*/
PolynomialConstraint(const VectorXPoly& polynomials,
const std::vector<Polynomiald::VarType>& poly_vars,
const Eigen::VectorXd& lb, const Eigen::VectorXd& ub)
: EvaluatorConstraint(
std::make_shared<PolynomialEvaluator>(polynomials, poly_vars), lb,
ub) {}
~PolynomialConstraint() override {}
const VectorXPoly& polynomials() const { return evaluator().polynomials(); }
const std::vector<Polynomiald::VarType>& poly_vars() const {
return evaluator().poly_vars();
}
};
// TODO(bradking): consider implementing DifferentiableConstraint,
// TwiceDifferentiableConstraint, ComplementarityConstraint,
// IntegerConstraint, ...
/**
* Implements a constraint of the form @f$ lb <= Ax <= ub @f$
*/
class LinearConstraint : public Constraint {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(LinearConstraint)
template <typename DerivedA, typename DerivedLB, typename DerivedUB>
LinearConstraint(const Eigen::MatrixBase<DerivedA>& a,
const Eigen::MatrixBase<DerivedLB>& lb,
const Eigen::MatrixBase<DerivedUB>& ub)
: Constraint(a.rows(), a.cols(), lb, ub), A_(a) {
DRAKE_DEMAND(a.rows() == lb.rows());
}
~LinearConstraint() override {}
virtual Eigen::SparseMatrix<double> GetSparseMatrix() const {
// TODO(eric.cousineau): Consider storing or caching sparse matrix, such
// that we can return a const lvalue reference.
return A_.sparseView();
}
virtual const Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic>& A()
const {
return A_;
}
/**
* Updates the linear term, upper and lower bounds in the linear constraint.
* The updated constraint is:
* new_lb <= new_A * x <= new_ub
* Note that the size of constraints (number of rows) can change, but the
* number of variables (number of cols) cannot.
* @param new_A new linear term
* @param new_lb new lower bound
* @param new_up new upper bound
*/
template <typename DerivedA, typename DerivedL, typename DerivedU>
void UpdateCoefficients(const Eigen::MatrixBase<DerivedA>& new_A,
const Eigen::MatrixBase<DerivedL>& new_lb,
const Eigen::MatrixBase<DerivedU>& new_ub) {
if (new_A.rows() != new_lb.rows() || new_lb.rows() != new_ub.rows() ||
new_lb.cols() != 1 || new_ub.cols() != 1) {
throw std::runtime_error("New constraints have invalid dimensions");
}
if (new_A.cols() != A_.cols()) {
throw std::runtime_error("Can't change the number of decision variables");
}
A_ = new_A;
set_num_outputs(A_.rows());
set_bounds(new_lb, new_ub);
}
using Constraint::set_bounds;
using Constraint::UpdateLowerBound;
using Constraint::UpdateUpperBound;
protected:
void DoEval(const Eigen::Ref<const Eigen::VectorXd>& x,
Eigen::VectorXd* y) const override;
void DoEval(const Eigen::Ref<const AutoDiffVecXd>& x,
AutoDiffVecXd* y) const override;
void DoEval(const Eigen::Ref<const VectorX<symbolic::Variable>>& x,
VectorX<symbolic::Expression>* y) const override;
std::ostream& DoDisplay(std::ostream&,
const VectorX<symbolic::Variable>&) const override;
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> A_;
private:
template <typename DerivedX, typename ScalarY>
void DoEvalGeneric(const Eigen::MatrixBase<DerivedX>& x,
VectorX<ScalarY>* y) const;
};
/**
* Implements a constraint of the form @f$ Ax = b @f$
*/
class LinearEqualityConstraint : public LinearConstraint {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(LinearEqualityConstraint)
template <typename DerivedA, typename DerivedB>
LinearEqualityConstraint(const Eigen::MatrixBase<DerivedA>& Aeq,
const Eigen::MatrixBase<DerivedB>& beq)
: LinearConstraint(Aeq, beq, beq) {}
LinearEqualityConstraint(const Eigen::Ref<const Eigen::RowVectorXd>& a,
double beq)
: LinearEqualityConstraint(a, Vector1d(beq)) {}
~LinearEqualityConstraint() override {}
/*
* @brief change the parameters of the constraint (A and b), but not the
*variable associations
*
* note that A and b can change size in the rows only (representing a
*different number of linear constraints, but on the same decision variables)
*/
template <typename DerivedA, typename DerivedB>
void UpdateCoefficients(const Eigen::MatrixBase<DerivedA>& Aeq,
const Eigen::MatrixBase<DerivedB>& beq) {
LinearConstraint::UpdateCoefficients(Aeq, beq, beq);
}
private:
/**
* The user should not call this function. Call UpdateCoefficients(Aeq, beq)
* instead.
*/
template <typename DerivedA, typename DerivedL, typename DerivedU>
void UpdateCoefficients(const Eigen::MatrixBase<DerivedA>&,
const Eigen::MatrixBase<DerivedL>&,
const Eigen::MatrixBase<DerivedU>&) {
static_assert(
!std::is_same<DerivedA, DerivedA>::value,
"This method should not be called form `LinearEqualityConstraint`");
}
std::ostream& DoDisplay(std::ostream&,
const VectorX<symbolic::Variable>&) const override;
};
/**
* Implements a constraint of the form @f$ lb <= x <= ub @f$
*
* Note: the base Constraint class (as implemented at the moment) could
* play this role. But this class enforces that it is ONLY a bounding
* box constraint, and not something more general. Some solvers use
* this information to handle bounding box constraints differently than
* general constraints, so use of this form is encouraged.
*/
class BoundingBoxConstraint : public LinearConstraint {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(BoundingBoxConstraint)
template <typename DerivedLB, typename DerivedUB>
BoundingBoxConstraint(const Eigen::MatrixBase<DerivedLB>& lb,
const Eigen::MatrixBase<DerivedUB>& ub)
: LinearConstraint(Eigen::MatrixXd::Identity(lb.rows(), lb.rows()), lb,
ub) {}
~BoundingBoxConstraint() override {}
private:
template <typename DerivedX, typename ScalarY>
void DoEvalGeneric(const Eigen::MatrixBase<DerivedX>& x,
VectorX<ScalarY>* y) const;
void DoEval(const Eigen::Ref<const Eigen::VectorXd>& x,
Eigen::VectorXd* y) const override;
void DoEval(const Eigen::Ref<const AutoDiffVecXd>& x,
AutoDiffVecXd* y) const override;
void DoEval(const Eigen::Ref<const VectorX<symbolic::Variable>>& x,
VectorX<symbolic::Expression>* y) const override;
std::ostream& DoDisplay(std::ostream&,
const VectorX<symbolic::Variable>&) const override;
};
/**
* Implements a constraint of the form:
*
* <pre>
* Mx + q >= 0
* x >= 0
* x'(Mx + q) == 0
* </pre>
*
* An implied slack variable complements any 0 component of x. To get
* the slack values at a given solution x, use Eval(x).
*/
class LinearComplementarityConstraint : public Constraint {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(LinearComplementarityConstraint)
template <typename DerivedM, typename Derivedq>
LinearComplementarityConstraint(const Eigen::MatrixBase<DerivedM>& M,
const Eigen::MatrixBase<Derivedq>& q)
: Constraint(q.rows(), M.cols()), M_(M), q_(q) {}
~LinearComplementarityConstraint() override {}
const Eigen::MatrixXd& M() const { return M_; }
const Eigen::VectorXd& q() const { return q_; }
protected:
void DoEval(const Eigen::Ref<const Eigen::VectorXd>& x,
Eigen::VectorXd* y) const override;
void DoEval(const Eigen::Ref<const AutoDiffVecXd>& x,
AutoDiffVecXd* y) const override;
void DoEval(const Eigen::Ref<const VectorX<symbolic::Variable>>& x,
VectorX<symbolic::Expression>* y) const override;
bool DoCheckSatisfied(const Eigen::Ref<const Eigen::VectorXd>& x,
const double tol) const override;
bool DoCheckSatisfied(const Eigen::Ref<const AutoDiffVecXd>& x,
const double tol) const override;
symbolic::Formula DoCheckSatisfied(
const Eigen::Ref<const VectorX<symbolic::Variable>>& x) const override;
private:
// Return Mx + q (the value of the slack variable).
template <typename DerivedX, typename ScalarY>
void DoEvalGeneric(const Eigen::MatrixBase<DerivedX>& x,
VectorX<ScalarY>* y) const;
// TODO(ggould-tri) We are storing what are likely statically sized matrices
// in dynamically allocated containers. This probably isn't optimal.
Eigen::MatrixXd M_;
Eigen::VectorXd q_;
};
/**
* Implements a positive semidefinite constraint on a symmetric matrix S
* @f[\text{
* S is p.s.d
* }@f]
* namely, all eigen values of S are non-negative.
*/
class PositiveSemidefiniteConstraint : public Constraint {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(PositiveSemidefiniteConstraint)
/**
* Impose the constraint that a symmetric matrix with size @p rows x @p rows
* is positive semidefinite.
* @see MathematicalProgram::AddPositiveSemidefiniteConstraint() for how
* to use this constraint on some decision variables. We currently use this
* constraint as a place holder in MathematicalProgram, to indicate the
* positive semidefiniteness of some decision variables.
* @param rows The number of rows (and columns) of the symmetric matrix.
*
* Example:
* @code{.cc}
* // Create a MathematicalProgram object.
* auto prog = MathematicalProgram();
*
* // Add a 2 x 2 symmetric matrix S to optimization program as new decision
* // variables.
* auto S = prog.NewSymmetricContinuousVariables<2>("S");
*
* // Impose a positive semidefinite constraint on S.
* std::shared_ptr<PositiveSemidefiniteConstraint> psd_constraint =
* prog.AddPositiveSemidefiniteConstraint(S);
*
* /////////////////////////////////////////////////////////////
* // Add more constraints to make the program more interesting,
* // but this is not needed.
*
* // Add the constraint that S(1, 0) = 1.
* prog.AddBoundingBoxConstraint(1, 1, S(1, 0));
*
* // Minimize S(0, 0) + S(1, 1).
* prog.AddLinearCost(Eigen::RowVector2d(1, 1), {S.diagonal()});
*
* /////////////////////////////////////////////////////////////
*
* // Now solve the program.
* auto result = Solve(prog);
*
* // Retrieve the solution of matrix S.
* auto S_value = GetSolution(S, result);
*
* // Compute the eigen values of the solution, to see if they are
* // all non-negative.
* Eigen::Vector4d S_stacked;
* S_stacked << S_value.col(0), S_value.col(1);
*
* Eigen::VectorXd S_eigen_values;
* psd_constraint->Eval(S_stacked, S_eigen_values);
*
* std::cout<<"S solution is: " << S << std::endl;
* std::cout<<"The eigen value of S is " << S_eigen_values << std::endl;
* @endcode
*/
explicit PositiveSemidefiniteConstraint(int rows)
: Constraint(rows, rows * rows, Eigen::VectorXd::Zero(rows),
Eigen::VectorXd::Constant(
rows, std::numeric_limits<double>::infinity())),
matrix_rows_(rows) {}
~PositiveSemidefiniteConstraint() override {}
int matrix_rows() const { return matrix_rows_; }
protected:
/**
* Evaluate the eigen values of the symmetric matrix.
* @param x The stacked columns of the symmetric matrix.
*/
void DoEval(const Eigen::Ref<const Eigen::VectorXd>& x,
Eigen::VectorXd* y) const override;
/**
* @param x The stacked columns of the symmetric matrix. This function is not
* supported yet, since Eigen's eigen value solver does not accept
* AutoDiffScalar.
*/
void DoEval(const Eigen::Ref<const AutoDiffVecXd>& x,
AutoDiffVecXd* y) const override;
/**
* @param x The stacked columns of the symmetric matrix. This function is not
* supported, since Eigen's eigen value solver does not accept
* symbolic::Expression.
*/
void DoEval(const Eigen::Ref<const VectorX<symbolic::Variable>>& x,
VectorX<symbolic::Expression>* y) const override;
private:
int matrix_rows_; // Number of rows in the symmetric matrix being positive
// semi-definite.
};
/**
* Impose the matrix inequality constraint on variable x
* <!-->
* Fโ + xโ * Fโ + ... xโ * Fโ is p.s.d
* <-->
* @f[
* F_0 + x_1 F_1 + ... + x_n F_n \text{ is p.s.d}
* @f]
* where p.s.d stands for positive semidefinite.
* @f$ F_0, F_1, ..., F_n @f$ are all given symmetric matrices of the same size.
*/
class LinearMatrixInequalityConstraint : public Constraint {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(LinearMatrixInequalityConstraint)
/**
* @param F Each symmetric matrix F[i] should be of the same size.
* @param symmetry_tolerance The precision to determine if the input matrices
* Fi are all symmetric. @see math::IsSymmetric().
*/
LinearMatrixInequalityConstraint(
const std::vector<Eigen::Ref<const Eigen::MatrixXd>>& F,
double symmetry_tolerance = 1E-10);
~LinearMatrixInequalityConstraint() override {}
/* Getter for all given matrices F */
const std::vector<Eigen::MatrixXd>& F() const { return F_; }
/// Gets the number of rows in the matrix inequality constraint. Namely
/// Fi are all matrix_rows() x matrix_rows() matrices.
int matrix_rows() const { return matrix_rows_; }
protected:
/**
* Evaluate the eigen values of the linear matrix.
*/
void DoEval(const Eigen::Ref<const Eigen::VectorXd>& x,
Eigen::VectorXd* y) const override;
/**
* This function is not supported, since Eigen's eigen value solver does not
* accept AutoDiffScalar type.
*/
void DoEval(const Eigen::Ref<const AutoDiffVecXd>& x,
AutoDiffVecXd* y) const override;
/**
* This function is not supported, since Eigen's eigen value solver does not
* accept symbolic::Expression type.
*/
void DoEval(const Eigen::Ref<const VectorX<symbolic::Variable>>& x,
VectorX<symbolic::Expression>* y) const override;
private:
std::vector<Eigen::MatrixXd> F_;
const int matrix_rows_{};
};
/**
* Impose a generic (potentially nonlinear) constraint represented as a
* vector of symbolic Expression. Expression::Evaluate is called on every
* constraint evaluation.
*
* Uses symbolic::Jacobian to provide the gradients to the AutoDiff method.
*/
class ExpressionConstraint : public Constraint {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(ExpressionConstraint)
ExpressionConstraint(const Eigen::Ref<const VectorX<symbolic::Expression>>& v,
const Eigen::Ref<const Eigen::VectorXd>& lb,
const Eigen::Ref<const Eigen::VectorXd>& ub);
/**
* @return the list of the variables involved in the vector of expressions,
* in the order that they are expected to be received during DoEval.
* Any Binding that connects this constraint to decision variables should
* pass this list of variables to the Binding.
*/
const VectorXDecisionVariable& vars() const { return vars_; }
/** @return the symbolic expressions. */
const VectorX<symbolic::Expression>& expressions() const {
return expressions_;
}
protected:
void DoEval(const Eigen::Ref<const Eigen::VectorXd>& x,
Eigen::VectorXd* y) const override;
void DoEval(const Eigen::Ref<const AutoDiffVecXd>& x,
AutoDiffVecXd* y) const override;
void DoEval(const Eigen::Ref<const VectorX<symbolic::Variable>>& x,
VectorX<symbolic::Expression>* y) const override;
private:
VectorX<symbolic::Expression> expressions_{0};
MatrixX<symbolic::Expression> derivatives_{0, 0};
// map_var_to_index_[vars_(i).get_id()] = i.
VectorXDecisionVariable vars_{0};
std::unordered_map<symbolic::Variable::Id, int> map_var_to_index_;
// Only for caching, does not carrying hidden state.
mutable symbolic::Environment environment_;
};
/**
* An exponential cone constraint is a special type of convex cone constraint.
* We constrain A * x + b to be in the exponential cone, where A has 3 rows, and
* b is in โยณ, x is the decision variable.
* A vector z in โยณ is in the exponential cone, if
* {zโ, zโ, zโ | zโ โฅ zโ * exp(zโ / zโ), zโ > 0}.
* Equivalently, this constraint can be refomulated with logarithm function
* {zโ, zโ, zโ | zโ โค zโ * log(zโ / zโ), zโ > 0, zโ > 0}
*
* The Eval function implemented in this class is
* zโ - zโ * exp(zโ / zโ) >= 0,
* zโ > 0
* where z = A * x + b.
* It is not recommended to solve an exponential cone constraint through
* generic nonlinear optimization. It is possible that the nonlinear solver
* can accidentally set zโ = 0, where the constraint is not well defined.
* Instead, the user should consider to solve the program through conic solvers
* that can exploit exponential cone, such as Mosek and SCS.
*/
class ExponentialConeConstraint : public Constraint {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(ExponentialConeConstraint)
/**
* Constructor for exponential cone.
* Constrains A * x + b to be in the exponential cone.
* @pre A has 3 rows.
*/
ExponentialConeConstraint(
const Eigen::Ref<const Eigen::SparseMatrix<double>>& A,
const Eigen::Ref<const Eigen::Vector3d>& b);
~ExponentialConeConstraint() override{};
/** Getter for matrix A. */
const Eigen::SparseMatrix<double>& A() const { return A_; }
/** Getter for vector b. */
const Eigen::Vector3d& b() const { return b_; }
protected:
template <typename DerivedX, typename ScalarY>
void DoEvalGeneric(const Eigen::MatrixBase<DerivedX>& x,
VectorX<ScalarY>* y) const;
void DoEval(const Eigen::Ref<const Eigen::VectorXd>& x,
Eigen::VectorXd* y) const override;
void DoEval(const Eigen::Ref<const AutoDiffVecXd>& x,
AutoDiffVecXd* y) const override;
void DoEval(const Eigen::Ref<const VectorX<symbolic::Variable>>& x,
VectorX<symbolic::Expression>* y) const override;
private:
Eigen::SparseMatrix<double> A_;
Eigen::Vector3d b_;
};
} // namespace solvers
} // namespace drake
|
moriyoshi/aws-sdk-go-v2
|
service/ses/api_op_SendBulkTemplatedEmail.go
|
// Code generated by smithy-go-codegen DO NOT EDIT.
package ses
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/ses/types"
"github.com/awslabs/smithy-go/middleware"
smithyhttp "github.com/awslabs/smithy-go/transport/http"
)
// Composes an email message to multiple destinations. The message body is created
// using an email template. In order to send email using the SendBulkTemplatedEmail
// operation, your call to the API must meet the following requirements:
//
// * The
// call must refer to an existing email template. You can create email templates
// using the CreateTemplate operation.
//
// * The message must be sent from a
// verified email address or domain.
//
// * If your account is still in the Amazon
// SES sandbox, you may only send to verified addresses or domains, or to email
// addresses associated with the Amazon SES Mailbox Simulator. For more
// information, see Verifying Email Addresses and Domains
// (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html)
// in the Amazon SES Developer Guide.
//
// * The maximum message size is 10 MB.
//
//
// * Each Destination parameter must include at least one recipient email address.
// The recipient address can be a To: address, a CC: address, or a BCC: address. If
// a recipient email address is invalid (that is, it is not in the format
// UserName@[SubDomain.]Domain.TopLevelDomain), the entire message will be
// rejected, even if the message contains other recipients that are valid.
//
// *
// The message may not include more than 50 recipients, across the To:, CC: and
// BCC: fields. If you need to send an email message to a larger audience, you can
// divide your recipient list into groups of 50 or fewer, and then call the
// SendBulkTemplatedEmail operation several times to send the message to each
// group.
//
// * The number of destinations you can contact in a single call to the
// API may be limited by your account's maximum sending rate.
func (c *Client) SendBulkTemplatedEmail(ctx context.Context, params *SendBulkTemplatedEmailInput, optFns ...func(*Options)) (*SendBulkTemplatedEmailOutput, error) {
if params == nil {
params = &SendBulkTemplatedEmailInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SendBulkTemplatedEmail", params, optFns, addOperationSendBulkTemplatedEmailMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SendBulkTemplatedEmailOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents a request to send a templated email to multiple destinations using
// Amazon SES. For more information, see the Amazon SES Developer Guide
// (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-personalized-email-api.html).
type SendBulkTemplatedEmailInput struct {
// One or more Destination objects. All of the recipients in a Destination will
// receive the same version of the email. You can specify up to 50 Destination
// objects within a Destinations array.
//
// This member is required.
Destinations []*types.BulkEmailDestination
// The email address that is sending the email. This email address must be either
// individually verified with Amazon SES, or from a domain that has been verified
// with Amazon SES. For information about verifying identities, see the Amazon SES
// Developer Guide
// (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html).
// If you are sending on behalf of another user and have been permitted to do so by
// a sending authorization policy, then you must also specify the SourceArn
// parameter. For more information about sending authorization, see the Amazon SES
// Developer Guide
// (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html).
// Amazon SES does not support the SMTPUTF8 extension, as described in RFC6531
// (https://tools.ietf.org/html/rfc6531). For this reason, the local part of a
// source email address (the part of the email address that precedes the @ sign)
// may only contain 7-bit ASCII characters
// (https://en.wikipedia.org/wiki/Email_address#Local-part). If the domain part of
// an address (the part after the @ sign) contains non-ASCII characters, they must
// be encoded using Punycode, as described in RFC3492
// (https://tools.ietf.org/html/rfc3492.html). The sender name (also known as the
// friendly name) may contain non-ASCII characters. These characters must be
// encoded using MIME encoded-word syntax, as described in RFC 2047
// (https://tools.ietf.org/html/rfc2047). MIME encoded-word syntax uses the
// following form: =?charset?encoding?encoded-text?=.
//
// This member is required.
Source *string
// The template to use when sending this email.
//
// This member is required.
Template *string
// The name of the configuration set to use when you send an email using
// SendBulkTemplatedEmail.
ConfigurationSetName *string
// A list of tags, in the form of name/value pairs, to apply to an email that you
// send to a destination using SendBulkTemplatedEmail.
DefaultTags []*types.MessageTag
// A list of replacement values to apply to the template when replacement data is
// not specified in a Destination object. These values act as a default or fallback
// option when no other data is available. The template data is a JSON object,
// typically consisting of key-value pairs in which the keys correspond to
// replacement tags in the email template.
DefaultTemplateData *string
// The reply-to email address(es) for the message. If the recipient replies to the
// message, each reply-to address will receive the reply.
ReplyToAddresses []*string
// The email address that bounces and complaints will be forwarded to when feedback
// forwarding is enabled. If the message cannot be delivered to the recipient, then
// an error message will be returned from the recipient's ISP; this message will
// then be forwarded to the email address specified by the ReturnPath parameter.
// The ReturnPath parameter is never overwritten. This email address must be either
// individually verified with Amazon SES, or from a domain that has been verified
// with Amazon SES.
ReturnPath *string
// This parameter is used only for sending authorization. It is the ARN of the
// identity that is associated with the sending authorization policy that permits
// you to use the email address specified in the ReturnPath parameter. For example,
// if the owner of example.com (which has ARN
// arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it
// that authorizes you to use <EMAIL>, then you would specify the
// ReturnPathArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and
// the ReturnPath to be <EMAIL>. For more information about sending
// authorization, see the Amazon SES Developer Guide
// (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html).
ReturnPathArn *string
// This parameter is used only for sending authorization. It is the ARN of the
// identity that is associated with the sending authorization policy that permits
// you to send for the email address specified in the Source parameter. For
// example, if the owner of example.com (which has ARN
// arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it
// that authorizes you to send from <EMAIL>, then you would specify the
// SourceArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the
// Source to be <EMAIL>. For more information about sending authorization,
// see the Amazon SES Developer Guide
// (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html).
SourceArn *string
// The ARN of the template to use when sending this email.
TemplateArn *string
}
type SendBulkTemplatedEmailOutput struct {
// The unique message identifier returned from the SendBulkTemplatedEmail action.
//
// This member is required.
Status []*types.BulkEmailDestinationStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
}
func addOperationSendBulkTemplatedEmailMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsquery_serializeOpSendBulkTemplatedEmail{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSendBulkTemplatedEmail{}, middleware.After)
if err != nil {
return err
}
awsmiddleware.AddRequestInvocationIDMiddleware(stack)
smithyhttp.AddContentLengthMiddleware(stack)
addResolveEndpointMiddleware(stack, options)
v4.AddComputePayloadSHA256Middleware(stack)
addRetryMiddlewares(stack, options)
addHTTPSignerV4Middleware(stack, options)
awsmiddleware.AddAttemptClockSkewMiddleware(stack)
addClientUserAgent(stack)
smithyhttp.AddErrorCloseResponseBodyMiddleware(stack)
smithyhttp.AddCloseResponseBodyMiddleware(stack)
addOpSendBulkTemplatedEmailValidationMiddleware(stack)
stack.Initialize.Add(newServiceMetadataMiddleware_opSendBulkTemplatedEmail(options.Region), middleware.Before)
addRequestIDRetrieverMiddleware(stack)
addResponseErrorMiddleware(stack)
return nil
}
func newServiceMetadataMiddleware_opSendBulkTemplatedEmail(region string) awsmiddleware.RegisterServiceMetadata {
return awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "SendBulkTemplatedEmail",
}
}
|
n-dusan/wroom
|
renting-service/src/main/java/com/wroom/rentingservice/domain/Debt.java
|
package com.wroom.rentingservice.domain;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import com.wroom.rentingservice.domain.enums.DebtStatus;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Getter @Setter @NoArgsConstructor @AllArgsConstructor
public class Debt {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column
private Double miles;
@Column
private Long priceListId;
@Column
private Long rentRequestId;
//@ManyToOne(fetch = FetchType.LAZY,cascade = CascadeType.ALL)
//private User user;
@Column
private Long userId;
@Column
private DebtStatus status;
}
|
nistefan/cmssw
|
RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByCharge_cfi.py
|
<gh_stars>1-10
import FWCore.ParameterSet.Config as cms
from RecoTauTag.RecoTau.TauDiscriminatorTools import noPrediscriminants
pfRecoTauDiscriminationByCharge = cms.EDProducer("PFRecoTauDiscriminationByCharge",
# tau collection to discriminate
PFTauProducer = cms.InputTag('pfRecoTauProducerHighEfficiency'),
# no prediscriminants needed
Prediscriminants = noPrediscriminants,
# If true, additionally fail taus that do not have 1 or 3 tracks in the signal cone
ApplyOneOrThreeProngCut = cms.bool(False),
# Requirement on charge of tau (signal contents only)
AbsChargeReq = cms.uint32(1)
)
|
L8RMedia/exponent
|
ios/versioned-react-native/ABI8_0_0/Exponent/Modules/Api/Components/ABI8_0_0EXBlurViewManager.h
|
#import "ABI8_0_0RCTViewManager.h"
@interface ABI8_0_0EXBlurViewManager : ABI8_0_0RCTViewManager
@end
|
616c/java-com.sphenon.components.basics.application
|
src/main/java/com/sphenon/basics/application/ApplicationSessionRegistry.java
|
package com.sphenon.basics.application;
/****************************************************************************
Copyright 2001-2018 Sphenon GmbH
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
*****************************************************************************/
import com.sphenon.basics.context.*;
import com.sphenon.basics.message.*;
import com.sphenon.basics.notification.*;
import com.sphenon.basics.customary.*;
import com.sphenon.basics.application.classes.*;
import com.sphenon.basics.application.returncodes.*;
import java.util.Map;
import java.util.HashMap;
public class ApplicationSessionRegistry {
protected Map<String,ApplicationSession> registry;
public ApplicationSessionRegistry(CallContext context) {
}
// might throw: ALFInvalidSession (outdated)
// but then, it should be removed, shouldn't it?
public synchronized ApplicationSession get(CallContext context, String session_id) {
if (registry == null) {
return null;
}
return registry.get(session_id);
}
public synchronized void add(CallContext context, ApplicationSession application_session) {
if (registry == null) {
registry = new HashMap<String,ApplicationSession>();
}
registry.put(application_session.getId(context), application_session);
}
public synchronized void remove(CallContext context, ApplicationSession application_session) {
if (registry != null) {
registry.remove(application_session.getId(context));
}
}
}
|
mrninhvn/matter
|
src/platform/Darwin/DiagnosticDataProviderImpl.cpp
|
/*
*
* Copyright (c) 2021 Project CHIP Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* Provides an implementation of the DiagnosticDataProvider object
* for Darwin platform.
*/
#include <platform/internal/CHIPDeviceLayerInternal.h>
#include <lib/support/logging/CHIPLogging.h>
#include <platform/Darwin/DiagnosticDataProviderImpl.h>
#include <platform/DiagnosticDataProvider.h>
namespace chip {
namespace DeviceLayer {
DiagnosticDataProviderImpl & DiagnosticDataProviderImpl::GetDefaultInstance()
{
static DiagnosticDataProviderImpl sInstance;
return sInstance;
}
CHIP_ERROR DiagnosticDataProviderImpl::GetUpTime(uint64_t & upTime)
{
System::Clock::Timestamp currentTime = System::SystemClock().GetMonotonicTimestamp();
System::Clock::Timestamp startTime = PlatformMgrImpl().GetStartTime();
if (currentTime >= startTime)
{
upTime = std::chrono::duration_cast<System::Clock::Seconds64>(currentTime - startTime).count();
return CHIP_NO_ERROR;
}
return CHIP_ERROR_INVALID_TIME;
}
CHIP_ERROR DiagnosticDataProviderImpl::GetTotalOperationalHours(uint32_t & totalOperationalHours)
{
uint64_t upTime = 0;
if (GetUpTime(upTime) == CHIP_NO_ERROR)
{
uint32_t totalHours = 0;
if (ConfigurationMgr().GetTotalOperationalHours(totalHours) == CHIP_NO_ERROR)
{
VerifyOrReturnError(upTime / 3600 <= UINT32_MAX, CHIP_ERROR_INVALID_INTEGER_VALUE);
totalOperationalHours = totalHours + static_cast<uint32_t>(upTime / 3600);
return CHIP_NO_ERROR;
}
}
return CHIP_ERROR_INVALID_TIME;
}
CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks()
{
// If implemented, the server SHALL set the value of the CurrentHeapHighWatermark attribute to the
// value of the CurrentHeapUsed.
// On Darwin, overide with non-op to pass CI.
return CHIP_NO_ERROR;
}
} // namespace DeviceLayer
} // namespace chip
|
straceX/Ectoplasm
|
linux-1.2.0/linux/fs/isofs/namei.c
|
/*
* linux/fs/isofs/namei.c
*
* (C) 1992 <NAME> Modified for ISO9660 filesystem.
*
* (C) 1991 <NAME> - minix filesystem
*/
#ifdef MODULE
#include <linux/module.h>
#endif
#include <linux/sched.h>
#include <linux/iso_fs.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/stat.h>
#include <linux/fcntl.h>
#include <asm/segment.h>
#include <linux/malloc.h>
#include <linux/errno.h>
/*
* ok, we cannot use strncmp, as the name is not in our data space.
* Thus we'll have to use isofs_match. No big problem. Match also makes
* some sanity tests.
*
* NOTE! unlike strncmp, isofs_match returns 1 for success, 0 for failure.
*/
static int isofs_match(int len,const char * name, char * compare, int dlen)
{
if (!compare)
return 0;
/* check special "." and ".." files */
if (dlen == 1) {
/* "." */
if (compare[0] == 0) {
if (!len)
return 1;
compare = ".";
} else if (compare[0] == 1) {
compare = "..";
dlen = 2;
}
}
#if 0
if (len <= 2) printk("Match: %d %d %s %d %d \n",len,dlen,compare,de->name[0], dlen);
#endif
if (dlen != len)
return 0;
return !memcmp(name, compare, len);
}
/*
* isofs_find_entry()
*
* finds an entry in the specified directory with the wanted name. It
* returns the cache buffer in which the entry was found, and the entry
* itself (as an inode number). It does NOT read the inode of the
* entry - you'll have to do that yourself if you want to.
*/
static struct buffer_head * isofs_find_entry(struct inode * dir,
const char * name, int namelen, unsigned long * ino, unsigned long * ino_back)
{
unsigned long bufsize = ISOFS_BUFFER_SIZE(dir);
unsigned char bufbits = ISOFS_BUFFER_BITS(dir);
unsigned int block, i, f_pos, offset, inode_number;
struct buffer_head * bh;
void * cpnt = NULL;
unsigned int old_offset;
unsigned int backlink;
int dlen, rrflag, match;
char * dpnt;
struct iso_directory_record * de;
char c;
*ino = 0;
if (!dir) return NULL;
if (!(block = dir->u.isofs_i.i_first_extent)) return NULL;
f_pos = 0;
offset = f_pos & (bufsize - 1);
block = isofs_bmap(dir,f_pos >> bufbits);
if (!block || !(bh = bread(dir->i_dev,block,bufsize))) return NULL;
while (f_pos < dir->i_size) {
de = (struct iso_directory_record *) (bh->b_data + offset);
backlink = dir->i_ino;
inode_number = (block << bufbits) + (offset & (bufsize - 1));
/* If byte is zero, this is the end of file, or time to move to
the next sector. Usually 2048 byte boundaries. */
if (*((unsigned char *) de) == 0) {
brelse(bh);
offset = 0;
f_pos = ((f_pos & ~(ISOFS_BLOCK_SIZE - 1))
+ ISOFS_BLOCK_SIZE);
block = isofs_bmap(dir,f_pos>>bufbits);
if (!block || !(bh = bread(dir->i_dev,block,bufsize)))
return 0;
continue; /* Will kick out if past end of directory */
}
old_offset = offset;
offset += *((unsigned char *) de);
f_pos += *((unsigned char *) de);
/* Handle case where the directory entry spans two blocks.
Usually 1024 byte boundaries */
if (offset >= bufsize) {
unsigned int frag1;
frag1 = bufsize - old_offset;
cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
if (!cpnt) return 0;
memcpy(cpnt, bh->b_data + old_offset, frag1);
de = (struct iso_directory_record *) cpnt;
brelse(bh);
offset = f_pos & (bufsize - 1);
block = isofs_bmap(dir,f_pos>>bufbits);
if (!block || !(bh = bread(dir->i_dev,block,bufsize))) {
kfree(cpnt);
return 0;
};
memcpy((char *)cpnt+frag1, bh->b_data, offset);
}
/* Handle the '.' case */
if (de->name[0]==0 && de->name_len[0]==1) {
inode_number = dir->i_ino;
backlink = 0;
}
/* Handle the '..' case */
if (de->name[0]==1 && de->name_len[0]==1) {
#if 0
printk("Doing .. (%d %d)",
dir->i_sb->s_firstdatazone,
dir->i_ino);
#endif
if((dir->i_sb->u.isofs_sb.s_firstdatazone) != dir->i_ino)
inode_number = dir->u.isofs_i.i_backlink;
else
inode_number = dir->i_ino;
backlink = 0;
}
dlen = de->name_len[0];
dpnt = de->name;
/* Now convert the filename in the buffer to lower case */
rrflag = get_rock_ridge_filename(de, &dpnt, &dlen, dir);
if (rrflag) {
if (rrflag == -1) goto out; /* Relocated deep directory */
} else {
if(dir->i_sb->u.isofs_sb.s_mapping == 'n') {
for (i = 0; i < dlen; i++) {
c = dpnt[i];
if (c >= 'A' && c <= 'Z') c |= 0x20; /* lower case */
if (c == ';' && i == dlen-2 && dpnt[i+1] == '1') {
dlen -= 2;
break;
}
if (c == ';') c = '.';
de->name[i] = c;
}
/* This allows us to match with and without a trailing
period. */
if(dpnt[dlen-1] == '.' && namelen == dlen-1)
dlen--;
}
}
match = isofs_match(namelen,name,dpnt,dlen);
if (cpnt) {
kfree(cpnt);
cpnt = NULL;
}
if(rrflag) kfree(dpnt);
if (match) {
if(inode_number == -1) {
/* Should only happen for the '..' entry */
inode_number =
isofs_lookup_grandparent(dir,
find_rock_ridge_relocation(de,dir));
if(inode_number == -1){
/* Should never happen */
printk("Backlink not properly set.\n");
goto out;
}
}
*ino = inode_number;
*ino_back = backlink;
return bh;
}
}
out:
if (cpnt)
kfree(cpnt);
brelse(bh);
return NULL;
}
int isofs_lookup(struct inode * dir,const char * name, int len,
struct inode ** result)
{
unsigned long ino, ino_back;
struct buffer_head * bh;
#ifdef DEBUG
printk("lookup: %x %d\n",dir->i_ino, len);
#endif
*result = NULL;
if (!dir)
return -ENOENT;
if (!S_ISDIR(dir->i_mode)) {
iput(dir);
return -ENOENT;
}
ino = 0;
if (dcache_lookup(dir, name, len, &ino)) ino_back = dir->i_ino;
if (!ino) {
if (!(bh = isofs_find_entry(dir,name,len, &ino, &ino_back))) {
iput(dir);
return -ENOENT;
}
if (ino_back == dir->i_ino)
dcache_add(dir, name, len, ino);
brelse(bh);
};
if (!(*result = iget(dir->i_sb,ino))) {
iput(dir);
return -EACCES;
}
/* We need this backlink for the ".." entry unless the name that we
are looking up traversed a mount point (in which case the inode
may not even be on an iso9660 filesystem, and writing to
u.isofs_i would only cause memory corruption).
*/
if (ino_back && !(*result)->i_pipe && (*result)->i_sb == dir->i_sb) {
(*result)->u.isofs_i.i_backlink = ino_back;
}
iput(dir);
return 0;
}
|
conclave/pcduino
|
core/tone.go
|
<filename>core/tone.go
package core
import (
"fmt"
"os"
"syscall"
"unsafe"
)
// only pin 5 and 6 support tone function
const MAX_TONE_FREQ = 100000 //100kHz
type toneConfig struct {
pin byte
clksrc_div uint
active_cycle uint
}
type toneFreq struct {
freq, div, cycle uint
}
func findPWMSetting(freq uint) (pwm_source_div uint, pwm_active_cycle uint) {
i := 0
d1, d2 := 0, 0
size := len(tone_freq)
for i = 0; i < size-1; i++ {
d1 = int(tone_freq[i].freq) - int(freq)
if d1 < 0 {
break
}
d2 = int(tone_freq[i+1].freq) - int(freq)
if d2 < 0 {
if -d2 < d1 {
i++
}
break
}
}
pwm_source_div = tone_freq[i].div
pwm_active_cycle = tone_freq[i].cycle / 2
return
}
func Tone(pin byte, freq uint /*duration uint64*/) error {
if (pin != 5 && pin != 6) || freq > MAX_TONE_FREQ {
return fmt.Errorf("invalid pin/frequency: %d/%d", pin, freq)
}
tc := &toneConfig{pin, 0, 0}
if freq > 0 {
tc.clksrc_div, tc.active_cycle = findPWMSetting(freq)
}
fd, err := syscall.Open(pwm_dev, os.O_RDONLY, 0666)
if err != nil {
return err
}
defer syscall.Close(fd)
if err = Ioctl(fd, PWMTMR_TONE, uintptr(unsafe.Pointer(tc))); err != nil {
return err
}
return nil
}
func NoTone(pin byte) error {
if pin != 5 && pin != 6 {
return fmt.Errorf("invalid pin: %d", pin)
}
tc := &toneConfig{pin, 0, 0}
fd, err := syscall.Open(pwm_dev, os.O_RDONLY, 0666)
if err != nil {
return err
}
defer syscall.Close(fd)
if err = Ioctl(fd, PWMTMR_TONE, uintptr(unsafe.Pointer(tc))); err != nil {
return err
}
return nil
}
var tone_freq = []toneFreq{
{100000, 120, 2},
{66667, 180, 2},
{50000, 240, 2},
{33333, 360, 2},
{25000, 480, 2},
{22222, 180, 6},
{20000, 120, 10},
{16667, 360, 4},
{14286, 120, 14},
{13333, 180, 10},
{12500, 480, 4},
{11111, 360, 6},
{10000, 240, 10},
{9524, 180, 14},
{9091, 120, 22},
{8333, 480, 6},
{7692, 120, 26},
{7407, 180, 18},
{7143, 240, 14},
{6667, 360, 10},
{6250, 480, 8},
{6061, 180, 22},
{5882, 120, 34},
{5556, 360, 12},
{5263, 120, 38},
{5128, 180, 26},
{5000, 480, 10},
{4762, 360, 14},
{4545, 240, 22},
{4444, 180, 30},
{4348, 120, 46},
{4167, 480, 12},
{4000, 120, 50},
{3922, 180, 34},
{3846, 240, 26},
{3704, 360, 18},
{3571, 480, 14},
{3509, 180, 38},
{3448, 120, 58},
{3333, 360, 20},
{3226, 120, 62},
{3175, 180, 42},
{3125, 480, 16},
{3030, 360, 22},
{2941, 240, 34},
{2899, 180, 46},
{2857, 120, 70},
{2778, 480, 18},
{2703, 120, 74},
{2667, 180, 50},
{2632, 240, 38},
{2564, 360, 26},
{2500, 480, 20},
{2469, 180, 54},
{2439, 120, 82},
{2381, 360, 28},
{2326, 120, 86},
{2299, 180, 58},
{2273, 480, 22},
{2222, 360, 30},
{2174, 240, 46},
{2151, 180, 62},
{2128, 120, 94},
{2083, 480, 24},
{2041, 120, 98},
{2020, 180, 66},
{2000, 240, 50},
{1961, 360, 34},
{1923, 480, 26},
{1905, 180, 70},
{1887, 120, 106},
{1852, 360, 36},
{1818, 120, 110},
{1802, 180, 74},
{1786, 480, 28},
{1754, 360, 38},
{1724, 240, 58},
{1709, 180, 78},
{1695, 120, 118},
{1667, 480, 30},
{1639, 120, 122},
{1626, 180, 82},
{1613, 240, 62},
{1587, 360, 42},
{1563, 480, 32},
{1550, 180, 86},
{1538, 120, 130},
{1515, 360, 44},
{1493, 120, 134},
{1481, 180, 90},
{1471, 480, 34},
{1449, 360, 46},
{1429, 240, 70},
{1418, 180, 94},
{1408, 120, 142},
{1389, 480, 36},
{1370, 120, 146},
{1361, 180, 98},
{1351, 240, 74},
{1333, 360, 50},
{1316, 480, 38},
{1307, 180, 102},
{1299, 120, 154},
{1282, 360, 52},
{1266, 120, 158},
{1258, 180, 106},
{1250, 480, 40},
{1235, 360, 54},
{1220, 240, 82},
{1212, 180, 110},
{1205, 120, 166},
{1190, 480, 42},
{1176, 120, 170},
{1170, 180, 114},
{1163, 240, 86},
{1149, 360, 58},
{1136, 480, 44},
{1130, 180, 118},
{1124, 120, 178},
{1111, 360, 60},
{1099, 120, 182},
{1093, 180, 122},
{1087, 480, 46},
{1075, 360, 62},
{1064, 240, 94},
{1058, 180, 126},
{1053, 120, 190},
{1042, 480, 48},
{1031, 120, 194},
{1026, 180, 130},
{1020, 240, 98},
{1010, 360, 66},
{1000, 12000, 2},
{995, 180, 134},
{990, 120, 202},
{980, 360, 68},
{971, 120, 206},
{966, 180, 138},
{962, 480, 52},
{952, 360, 70},
{943, 240, 106},
{939, 180, 142},
{935, 120, 214},
{926, 480, 54},
{917, 120, 218},
{913, 180, 146},
{909, 240, 110},
{901, 360, 74},
{893, 480, 56},
{889, 180, 150},
{885, 120, 226},
{877, 360, 76},
{870, 120, 230},
{866, 180, 154},
{862, 480, 58},
{855, 360, 78},
{847, 240, 118},
{844, 180, 158},
{840, 120, 238},
{833, 480, 60},
{826, 120, 242},
{823, 180, 162},
{820, 240, 122},
{813, 360, 82},
{806, 480, 62},
{803, 180, 166},
{800, 120, 250},
{794, 360, 84},
{787, 120, 254},
{784, 180, 170},
{781, 480, 64},
{775, 360, 86},
{769, 240, 130},
{766, 180, 174},
{758, 480, 66},
{749, 180, 178},
{746, 240, 134},
{741, 360, 90},
{735, 480, 68},
{733, 180, 182},
{725, 360, 92},
{717, 180, 186},
{714, 480, 70},
{709, 360, 94},
{704, 240, 142},
{702, 180, 190},
{694, 480, 72},
{687, 180, 194},
{685, 240, 146},
{680, 360, 98},
{676, 480, 74},
{673, 180, 198},
{667, 360, 100},
{660, 180, 202},
{658, 480, 76},
{654, 360, 102},
{649, 240, 154},
{647, 180, 206},
{641, 480, 78},
{635, 180, 210},
{633, 240, 158},
{629, 360, 106},
{625, 480, 80},
{623, 180, 214},
{617, 360, 108},
{612, 180, 218},
{610, 480, 82},
{606, 360, 110},
{602, 240, 166},
{601, 180, 222},
{595, 480, 84},
{590, 180, 226},
{588, 240, 170},
{585, 360, 114},
{581, 480, 86},
{580, 180, 230},
{575, 360, 116},
{570, 180, 234},
{568, 480, 88},
{565, 360, 118},
{562, 240, 178},
{560, 180, 238},
{556, 480, 90},
{551, 180, 242},
{549, 240, 182},
{546, 360, 122},
{543, 480, 92},
{542, 180, 246},
{538, 360, 124},
{533, 180, 250},
{532, 480, 94},
{529, 360, 126},
{526, 240, 190},
{525, 180, 254},
{521, 480, 96},
{515, 240, 194},
{513, 360, 130},
{510, 480, 98},
{505, 360, 132},
{500, 24000, 2},
{498, 360, 134},
{495, 240, 202},
{490, 480, 102},
{485, 240, 206},
{483, 360, 138},
{481, 480, 104},
{476, 360, 140},
{472, 480, 106},
{469, 360, 142},
{467, 240, 214},
{463, 480, 108},
{459, 240, 218},
{457, 360, 146},
{455, 480, 110},
{450, 360, 148},
{446, 480, 112},
{444, 360, 150},
{442, 240, 226},
{439, 480, 114},
{435, 240, 230},
{433, 360, 154},
{431, 480, 116},
{427, 360, 156},
{424, 480, 118},
{422, 360, 158},
{420, 240, 238},
{417, 480, 120},
{413, 240, 242},
{412, 360, 162},
{410, 480, 122},
{407, 360, 164},
{403, 480, 124},
{402, 360, 166},
{400, 240, 250},
{397, 480, 126},
{394, 240, 254},
{392, 360, 170},
{391, 480, 128},
{388, 360, 172},
{385, 480, 130},
{383, 360, 174},
{379, 480, 132},
{375, 360, 178},
{373, 480, 134},
{370, 360, 180},
{368, 480, 136},
{366, 360, 182},
{362, 480, 138},
{358, 360, 186},
{357, 480, 140},
{355, 360, 188},
{352, 480, 142},
{351, 360, 190},
{347, 480, 144},
{344, 360, 194},
{342, 480, 146},
{340, 360, 196},
{338, 480, 148},
{337, 360, 198},
{333, 36000, 2},
{330, 360, 202},
{329, 480, 152},
{327, 360, 204},
{325, 480, 154},
{324, 360, 206},
{321, 480, 156},
{317, 360, 210},
{316, 480, 158},
{314, 360, 212},
{313, 480, 160},
{312, 360, 214},
{309, 480, 162},
{306, 360, 218},
{305, 480, 164},
{303, 360, 220},
{301, 480, 166},
{300, 360, 222},
{298, 480, 168},
{295, 360, 226},
{294, 480, 170},
{292, 360, 228},
{291, 480, 172},
{290, 360, 230},
{287, 480, 174},
{285, 360, 234},
{284, 480, 176},
{282, 360, 236},
{281, 480, 178},
{280, 360, 238},
{278, 480, 180},
{275, 480, 182},
{273, 360, 244},
{272, 480, 184},
{271, 360, 246},
{269, 480, 186},
{267, 360, 250},
{266, 480, 188},
{265, 360, 252},
{263, 480, 190},
{262, 360, 254},
{260, 480, 192},
{258, 480, 194},
{255, 480, 196},
{253, 480, 198},
{250, 48000, 2},
{248, 480, 202},
{245, 480, 204},
{243, 480, 206},
{240, 480, 208},
{238, 480, 210},
{236, 480, 212},
{234, 480, 214},
{231, 480, 216},
{229, 480, 218},
{227, 480, 220},
{225, 480, 222},
{223, 480, 224},
{221, 480, 226},
{219, 480, 228},
{217, 480, 230},
{216, 480, 232},
{214, 480, 234},
{212, 480, 236},
{210, 480, 238},
{208, 480, 240},
{207, 480, 242},
{205, 480, 244},
{203, 480, 246},
{202, 480, 248},
{200, 12000, 10},
{198, 480, 252},
{197, 480, 254},
{195, 480, 256},
{167, 72000, 2},
{143, 12000, 14},
{125, 48000, 4},
{111, 36000, 6},
{100, 24000, 10},
{91, 12000, 22},
{83, 72000, 4},
{77, 12000, 26},
{71, 24000, 14},
{67, 36000, 10},
{63, 48000, 8},
{59, 12000, 34},
{56, 72000, 6},
{53, 12000, 38},
{50, 48000, 10},
{48, 36000, 14},
{45, 24000, 22},
{43, 12000, 46},
{42, 72000, 8},
{40, 12000, 50},
{38, 24000, 26},
{37, 36000, 18},
{36, 48000, 14},
{34, 12000, 58},
{33, 72000, 10},
{32, 12000, 62},
{31, 48000, 16},
{30, 36000, 22},
{29, 24000, 34},
{28, 72000, 12},
{27, 12000, 74},
{26, 36000, 26},
{25, 48000, 20},
{24, 72000, 14},
{23, 48000, 22},
{22, 36000, 30},
{21, 72000, 16},
{20, 36000, 34},
{19, 72000, 18},
{18, 48000, 28},
{17, 72000, 20},
{16, 48000, 32},
{15, 72000, 22},
{14, 72000, 24},
{13, 72000, 26},
{12, 72000, 28},
{11, 72000, 30},
{10, 72000, 34},
{9, 72000, 38},
{8, 72000, 44},
{7, 72000, 50},
{6, 72000, 60},
{5, 72000, 74},
{4, 72000, 94},
{3, 72000, 132},
{2, 72000, 222},
{1, 72000, 256},
}
const (
NOTE_B0 = 31
NOTE_C1 = 33
NOTE_CS1 = 35
NOTE_D1 = 37
NOTE_DS1 = 39
NOTE_E1 = 41
NOTE_F1 = 44
NOTE_FS1 = 46
NOTE_G1 = 49
NOTE_GS1 = 52
NOTE_A1 = 55
NOTE_AS1 = 58
NOTE_B1 = 62
NOTE_C2 = 65
NOTE_CS2 = 69
NOTE_D2 = 73
NOTE_DS2 = 78
NOTE_E2 = 82
NOTE_F2 = 87
NOTE_FS2 = 93
NOTE_G2 = 98
NOTE_GS2 = 104
NOTE_A2 = 110
NOTE_AS2 = 117
NOTE_B2 = 123
NOTE_C3 = 131
NOTE_CS3 = 139
NOTE_D3 = 147
NOTE_DS3 = 156
NOTE_E3 = 165
NOTE_F3 = 175
NOTE_FS3 = 185
NOTE_G3 = 196
NOTE_GS3 = 208
NOTE_A3 = 220
NOTE_AS3 = 233
NOTE_B3 = 247
NOTE_C4 = 262
NOTE_CS4 = 277
NOTE_D4 = 294
NOTE_DS4 = 311
NOTE_E4 = 330
NOTE_F4 = 349
NOTE_FS4 = 370
NOTE_G4 = 392
NOTE_GS4 = 415
NOTE_A4 = 440
NOTE_AS4 = 466
NOTE_B4 = 494
NOTE_C5 = 523
NOTE_CS5 = 554
NOTE_D5 = 587
NOTE_DS5 = 622
NOTE_E5 = 659
NOTE_F5 = 698
NOTE_FS5 = 740
NOTE_G5 = 784
NOTE_GS5 = 831
NOTE_A5 = 880
NOTE_AS5 = 932
NOTE_B5 = 988
NOTE_C6 = 1047
NOTE_CS6 = 1109
NOTE_D6 = 1175
NOTE_DS6 = 1245
NOTE_E6 = 1319
NOTE_F6 = 1397
NOTE_FS6 = 1480
NOTE_G6 = 1568
NOTE_GS6 = 1661
NOTE_A6 = 1760
NOTE_AS6 = 1865
NOTE_B6 = 1976
NOTE_C7 = 2093
NOTE_CS7 = 2217
NOTE_D7 = 2349
NOTE_DS7 = 2489
NOTE_E7 = 2637
NOTE_F7 = 2794
NOTE_FS7 = 2960
NOTE_G7 = 3136
NOTE_GS7 = 3322
NOTE_A7 = 3520
NOTE_AS7 = 3729
NOTE_B7 = 3951
NOTE_C8 = 4186
NOTE_CS8 = 4435
NOTE_D8 = 4699
NOTE_DS8 = 4978
)
|
jsc-masshtab/vdi-server
|
backend/web_app/tests/test_statistics_report.py
|
<filename>backend/web_app/tests/test_statistics_report.py
# -*- coding: utf-8 -*-
import asyncio
from datetime import datetime, timedelta
import json
import pytest
from common.database import db
from tornado.testing import gen_test
from web_app.tests.utils import execute_scheme
from web_app.statistics.schema import statistics_schema
from web_app.tests.fixtures import (
fixt_db, # noqa: F401
fixt_redis_client,
fixt_user_locked, # noqa: F401
fixt_user, # noqa: F401
fixt_user_admin, # noqa: F401
fixt_auth_dir, # noqa: F401
fixt_mapping, # noqa: F401
fixt_launch_workers, # noqa
fixt_group, # noqa: F401
fixt_group_role, # noqa: F401
fixt_create_static_pool, # noqa: F401
fixt_controller, # noqa: F401
fixt_veil_client, # noqa: F401
get_auth_context, # noqa: F401
several_static_pools, # noqa: F401
several_static_pools_with_user, # noqa: F401
fixt_auth_context, # noqa
get_auth_context
)
from web_app.tests.utils import VdiHttpTestCase
from common.models.active_tk_connection import ActiveTkConnection, TkConnectionEvent
from common.models.auth import User
from common.models.pool import Pool
from common.models.vm import Vm
from common.settings import PAM_AUTH
from common.subscription_sources import WsMessageType
pytestmark = [
pytest.mark.asyncio,
pytest.mark.skipif(PAM_AUTH, reason="not finished yet"),
]
async def test_web_statistics_report(snapshot, fixt_db, fixt_auth_context): # noqa
query = """{
web_statistics_report(month:11, year:2022)
}"""
executed = await execute_scheme(statistics_schema, query, context=fixt_auth_context)
snapshot.assert_match(executed)
class TestPoolStatistics(VdiHttpTestCase):
@pytest.mark.usefixtures("fixt_db", "fixt_user", "fixt_create_static_pool")
@gen_test
async def test_pools_statistics_ok(self):
# clear all
await db.status(db.text("TRUNCATE TABLE active_tk_connection CASCADE;"))
# login
(user_name, access_token) = await self.do_login(user_name="test_user", password="<PASSWORD>")
# connect to ws
ws_client = await self.connect_to_thin_client_ws(access_token)
assert ws_client
pool = await Pool.query.where(Pool.pool_type == Pool.PoolTypes.STATIC).gino.first()
vm_id = await Vm.select("id").where(Vm.pool_id == pool.id).gino.scalar() # id ะะ, ัะพะทะดะฐะฝะฝะพะน ะฒ ัะธะบััััะต
try:
# update (ะญะผัะปะธัะพะฒะฐัั ะฟะพะดะบะปััะตะฝะธะต ะบ ะะ)
update_data_dict = {
"msg_type": WsMessageType.UPDATED.value,
"vm_id": str(vm_id),
"event": TkConnectionEvent.VM_CONNECTED.value,
}
ws_client.write_message(json.dumps(update_data_dict))
await asyncio.sleep(1) # ะะพะดะพะถะดะตะผ ัะฐะบ ะบะฐะบ ะฝะฐ update ะพัะฒะตัะพะฒ ะฝะต ะฟัะธััะปะฐะตััั
# test statistics
lst = datetime.now()
fst = lst - timedelta(hours=24)
qu = (
"""
{
pool_usage_statistics(start_date: "%s", end_date: "%s", pool_id: "%s") {
successful_conn_number
disconn_number
conn_err_number
conn_duration_average
conn_errors {
name
conn_number
}
used_pools_overall {
name
conn_number
}
used_client_os {
name
conn_number
}
used_client_versions {
name
conn_number
}
users {
name
conn_number
}
conn_number_by_time_interval {
time_interval
conn_number
percentage
}
}
}
"""
% (fst.replace(microsecond=0).isoformat(), lst.replace(microsecond=0).isoformat(), pool.id)
)
auth_context = await get_auth_context()
executed = await execute_scheme(statistics_schema, qu, context=auth_context)
assert executed["pool_usage_statistics"]["successful_conn_number"] == 1
assert executed["pool_usage_statistics"]["conn_err_number"] == 0
assert executed["pool_usage_statistics"]["used_pools_overall"][0]["name"] == pool.verbose_name
assert executed["pool_usage_statistics"]["used_pools_overall"][0]["conn_number"] == 1
assert executed["pool_usage_statistics"]["used_client_os"][0]["name"] == "Linux"
assert executed["pool_usage_statistics"]["used_client_os"][0]["conn_number"] == 1
assert executed["pool_usage_statistics"]["users"][0]["name"] == user_name
assert executed["pool_usage_statistics"]["users"][0]["conn_number"] == 1
assert executed["pool_usage_statistics"]["used_client_versions"][0]["name"] == "1.4.1"
assert executed["pool_usage_statistics"]["used_client_versions"][0]["conn_number"] == 1
except Exception:
raise
finally:
# disconnect
ws_client.close()
await asyncio.sleep(0.1)
|
Jaraffe-github/Old_Engines
|
JaraffeEngine_Vulkan/Engine/Core/RHI/Vulkan/VulkanConverter.h
|
<filename>JaraffeEngine_Vulkan/Engine/Core/RHI/Vulkan/VulkanConverter.h
#pragma once
static inline VkFormat JFToVkFormat(VertexElementType Type)
{
switch (Type)
{
case VET_Float1:
return VK_FORMAT_R32_SFLOAT;
case VET_Float2:
return VK_FORMAT_R32G32_SFLOAT;
case VET_Float3:
return VK_FORMAT_R32G32B32_SFLOAT;
case VET_PackedNormal:
return VK_FORMAT_R8G8B8A8_UNORM;
case VET_UByte4:
return VK_FORMAT_R8G8B8A8_UINT;
case VET_UByte4N:
return VK_FORMAT_R8G8B8A8_UNORM;
case VET_Color:
return VK_FORMAT_B8G8R8A8_UNORM;
case VET_Short2:
return VK_FORMAT_R16G16_SINT;
case VET_Short4:
return VK_FORMAT_R16G16B16A16_SINT;
case VET_Short2N:
return VK_FORMAT_R16G16_SNORM;
case VET_Half2:
return VK_FORMAT_R16G16_SFLOAT;
case VET_Half4:
return VK_FORMAT_R16G16B16A16_SFLOAT;
case VET_Short4N: // 4 X 16 bit word: normalized
return VK_FORMAT_R16G16B16A16_SNORM;
case VET_UShort2:
return VK_FORMAT_R16G16_UINT;
case VET_UShort4:
return VK_FORMAT_R16G16B16A16_UINT;
case VET_UShort2N: // 16 bit word normalized to (value/65535.0:value/65535.0:0:0:1)
return VK_FORMAT_R16G16_UNORM;
case VET_UShort4N: // 4 X 16 bit word unsigned: normalized
return VK_FORMAT_R16G16B16A16_UNORM;
case VET_Float4:
return VK_FORMAT_R32G32B32A32_SFLOAT;
case VET_URGB10A2N:
return VK_FORMAT_A2B10G10R10_UNORM_PACK32;
default:
break;
}
return VK_FORMAT_UNDEFINED;
}
|
benpao123/terraform-provider-jdcloud
|
vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/rds/apis/SetImportFileShared.go
|
<reponame>benpao123/terraform-provider-jdcloud
// Copyright 2018 JDCLOUD.COM
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// NOTE: This class is auto generated by the jdcloud code generator program.
package apis
import (
"github.com/jdcloud-api/jdcloud-sdk-go/core"
)
type SetImportFileSharedRequest struct {
core.JDCloudRequest
/* ๅฐๅไปฃ็ ๏ผๅๅผ่ๅดๅ่ง[ใๅๅฐๅๅๅฏ็จๅบๅฏน็
ง่กจใ](../Enum-Definitions/Regions-AZ.md) */
RegionId string `json:"regionId"`
/* RDS ๅฎไพID๏ผๅฏไธๆ ่ฏไธไธชRDSๅฎไพ */
InstanceId string `json:"instanceId"`
/* ๅๅบไธไบๆไปถๅ */
FileName string `json:"fileName"`
/* ๆไปถๆฏๅฆๅ
ฑไบซ<br>true:ๅ
ฑไบซ<br>false:ไธๅ
ฑไบซ */
Shared string `json:""`
}
/*
* param regionId: ๅฐๅไปฃ็ ๏ผๅๅผ่ๅดๅ่ง[ใๅๅฐๅๅๅฏ็จๅบๅฏน็
ง่กจใ](../Enum-Definitions/Regions-AZ.md) (Required)
* param instanceId: RDS ๅฎไพID๏ผๅฏไธๆ ่ฏไธไธชRDSๅฎไพ (Required)
* param fileName: ๅๅบไธไบๆไปถๅ (Required)
* param shared: ๆไปถๆฏๅฆๅ
ฑไบซ<br>true:ๅ
ฑไบซ<br>false:ไธๅ
ฑไบซ (Required)
*
* @Deprecated, not compatible when mandatory parameters changed
*/
func NewSetImportFileSharedRequest(
regionId string,
instanceId string,
fileName string,
shared string,
) *SetImportFileSharedRequest {
return &SetImportFileSharedRequest{
JDCloudRequest: core.JDCloudRequest{
URL: "/regions/{regionId}/instances/{instanceId}/importFiles/{fileName}:setShared",
Method: "POST",
Header: nil,
Version: "v1",
},
RegionId: regionId,
InstanceId: instanceId,
FileName: fileName,
Shared: shared,
}
}
/*
* param regionId: ๅฐๅไปฃ็ ๏ผๅๅผ่ๅดๅ่ง[ใๅๅฐๅๅๅฏ็จๅบๅฏน็
ง่กจใ](../Enum-Definitions/Regions-AZ.md) (Required)
* param instanceId: RDS ๅฎไพID๏ผๅฏไธๆ ่ฏไธไธชRDSๅฎไพ (Required)
* param fileName: ๅๅบไธไบๆไปถๅ (Required)
* param shared: ๆไปถๆฏๅฆๅ
ฑไบซ<br>true:ๅ
ฑไบซ<br>false:ไธๅ
ฑไบซ (Required)
*/
func NewSetImportFileSharedRequestWithAllParams(
regionId string,
instanceId string,
fileName string,
shared string,
) *SetImportFileSharedRequest {
return &SetImportFileSharedRequest{
JDCloudRequest: core.JDCloudRequest{
URL: "/regions/{regionId}/instances/{instanceId}/importFiles/{fileName}:setShared",
Method: "POST",
Header: nil,
Version: "v1",
},
RegionId: regionId,
InstanceId: instanceId,
FileName: fileName,
Shared: shared,
}
}
/* This constructor has better compatible ability when API parameters changed */
func NewSetImportFileSharedRequestWithoutParam() *SetImportFileSharedRequest {
return &SetImportFileSharedRequest{
JDCloudRequest: core.JDCloudRequest{
URL: "/regions/{regionId}/instances/{instanceId}/importFiles/{fileName}:setShared",
Method: "POST",
Header: nil,
Version: "v1",
},
}
}
/* param regionId: ๅฐๅไปฃ็ ๏ผๅๅผ่ๅดๅ่ง[ใๅๅฐๅๅๅฏ็จๅบๅฏน็
ง่กจใ](../Enum-Definitions/Regions-AZ.md)(Required) */
func (r *SetImportFileSharedRequest) SetRegionId(regionId string) {
r.RegionId = regionId
}
/* param instanceId: RDS ๅฎไพID๏ผๅฏไธๆ ่ฏไธไธชRDSๅฎไพ(Required) */
func (r *SetImportFileSharedRequest) SetInstanceId(instanceId string) {
r.InstanceId = instanceId
}
/* param fileName: ๅๅบไธไบๆไปถๅ(Required) */
func (r *SetImportFileSharedRequest) SetFileName(fileName string) {
r.FileName = fileName
}
/* param shared: ๆไปถๆฏๅฆๅ
ฑไบซ<br>true:ๅ
ฑไบซ<br>false:ไธๅ
ฑไบซ(Required) */
func (r *SetImportFileSharedRequest) SetShared(shared string) {
r.Shared = shared
}
// GetRegionId returns path parameter 'regionId' if exist,
// otherwise return empty string
func (r SetImportFileSharedRequest) GetRegionId() string {
return r.RegionId
}
type SetImportFileSharedResponse struct {
RequestID string `json:"requestId"`
Error core.ErrorResponse `json:"error"`
Result SetImportFileSharedResult `json:"result"`
}
type SetImportFileSharedResult struct {
}
|
zerowzl/leetcode
|
java/src/tree/flattenBinaryTreeToLinkedList/FlattenBinaryTreeToLinkedList.java
|
package tree.flattenBinaryTreeToLinkedList;
/* *****************************************************************************
114.ไบๅๆ ๅฑๅผไธบ้พ่กจ
็ปไฝ ไบๅๆ ็ๆ น็ป็น root ๏ผ่ฏทไฝ ๅฐๅฎๅฑๅผไธบไธไธชๅ้พ่กจ๏ผ
ๅฑๅผๅ็ๅ้พ่กจๅบ่ฏฅๅๆ ทไฝฟ็จ TreeNode ๏ผๅ
ถไธญ right ๅญๆ้ๆๅ้พ่กจไธญไธไธไธช็ป็น๏ผ่ๅทฆๅญๆ้ๅง็ปไธบ null ใ
ๅฑๅผๅ็ๅ้พ่กจๅบ่ฏฅไธไบๅๆ ๅ
ๅบ้ๅ ้กบๅบ็ธๅใ
็คบไพ 1๏ผ
่พๅ
ฅ๏ผroot = [1,2,5,3,4,null,6]
่พๅบ๏ผ[1,null,2,null,3,null,4,null,5,null,6]
็คบไพ 2๏ผ
่พๅ
ฅ๏ผroot = []
่พๅบ๏ผ[]
็คบไพ 3๏ผ
่พๅ
ฅ๏ผroot = [0]
่พๅบ๏ผ[0]
ๆ็คบ๏ผ
ๆ ไธญ็ป็นๆฐๅจ่ๅด [0, 2000] ๅ
-100 <= Node.val <= 100
่ฟ้ถ๏ผไฝ ๅฏไปฅไฝฟ็จๅๅฐ็ฎๆณ๏ผO(1) ้ขๅค็ฉบ้ด๏ผๅฑๅผ่ฟๆฃตๆ ๅ๏ผ
*******************************************************************************/
/* *****************************************************************************
้ข่งฃ๏ผ
ไฝฟ็จๅๅบ้ๅๅพๅฐๆๆ็่็น๏ผ็ถๅๆๅบ่ฎพ็ฝฎ
ๅคๆๅบฆๅๆ๏ผ
ๆถ้ดๅคๆๅบฆ๏ผO(n)
็ฉบ้ดๅคๆๅบฆ๏ผO(n)
*******************************************************************************/
import java.util.ArrayList;
import java.util.List;
/**
* @author <NAME>
*/
public class FlattenBinaryTreeToLinkedList {
public void flatten(TreeNode root) {
List<TreeNode> res = new ArrayList<>();
preorderTraversal(root, res);
TreeNode prev = new TreeNode(0, null, null);
for (TreeNode node : res) {
if (node != null) {
node.left = null;
node.right = null;
prev.right = node;
prev = prev.right;
}
}
}
private void preorderTraversal(TreeNode root, List<TreeNode> res) {
if (root == null) {
res.add(null);
return;
}
res.add(root);
preorderTraversal(root.left, res);
preorderTraversal(root.right, res);
}
}
|
jsirex/jsirex-workstation-cookbook
|
recipes/vagrant.rb
|
<filename>recipes/vagrant.rb<gh_stars>0
# frozen_string_literal: true
vagrant_url = node['jsirex']['workstation']['vagrant']['download_url']
vagrant_checksum = node['jsirex']['workstation']['vagrant']['checksum']
vagrant_version = node['jsirex']['workstation']['vagrant']['version']
vagrant_deb = File.join(Chef::Config[:file_cache_path], File.basename(vagrant_url))
remote_file vagrant_deb do
source vagrant_url
checksum vagrant_checksum
end
dpkg_package "vagrant-#{vagrant_version}" do
source vagrant_deb
version vagrant_version
end
|
atish3/mig-website
|
mig_main/migrations/0007_memberprofile_location.py
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import mig_main.location_field
class Migration(migrations.Migration):
dependencies = [
('mig_main', '0006_userprofile_maiden_name'),
]
operations = [
migrations.AddField(
model_name='memberprofile',
name='location',
field=mig_main.location_field.LocationField(null=True, blank=True),
preserve_default=True,
),
]
|
DesZou/Eros
|
test/20171018/source/std/test20171018/source/pl/sky/shopping.cpp
|
#include <cstdio>
#include <set>
#include <cstring>
#include <algorithm>
using std::pair;
using std::find;
using std::multiset;
#define Pair pair<LL,LL>
template <typename Tp>Tp Max(const Tp &a, const Tp &b) {return a > b ? a : b;}
template <typename Tp>Tp Min(const Tp &a, const Tp &b) {return a < b ? a : b;}
template <typename Tp>void Read(Tp &x) {
Tp in = 0, f = 1; char ch = getchar();
while(ch<'0' || ch>'9') {if(ch=='-') f = -1; ch = getchar();}
while(ch>='0' && ch<='9') {in = in*10+ch-'0'; ch = getchar();}
x = in*f;
}
typedef long long LL;
const int SN = 200000 + 10;
const int SM = 100000 + 10;
multiset<LL> num[SN];
Pair max[SN<<2], empty;
LL hashs[SN], n, m;
LL w[SM], p[SM], cnt;
struct POINT {
int opt;
LL x, w, p, k;
}Q[SM];
void pushup(int rt) {
if(max[rt<<1].first >= max[rt<<1|1].first) max[rt] = max[rt<<1];
else max[rt] = max[rt<<1|1];
}
void Modify(int pos, Pair C, int l, int r, int rt) {
if(l == r) {
if(C.first > max[rt].first
|| (C.first == max[rt].first && C.second < max[rt].second))
max[rt] = C;
return ;
}
int mid = (l+r)>>1;
if(pos <= mid) Modify(pos, C, l, mid, rt<<1);
else Modify(pos, C, mid+1, r, rt<<1|1);
pushup(rt);
}
void cover(int pos, Pair C, int l, int r, int rt) {
if(l == r) {
max[rt] = C; return ;
}
int mid = (l+r)>>1;
if(pos <= mid) cover(pos, C, l, mid, rt<<1);
else cover(pos, C, mid+1, r, rt<<1|1);
pushup(rt);
}
void Query(int QL, int QR, int l, int r, int rt, Pair &ans) {
if(max[rt] == empty) return ;
if(QL <= l && QR >= r) {
if(max[rt].first > ans.first ||
(max[rt].first == ans.first && max[rt].second < ans.second))
ans = max[rt];
return ;
}
int mid = (l+r)>>1;
if(QL <= mid) Query(QL, QR, l, mid, rt<<1, ans);
if(QR > mid) Query(QL, QR, mid+1, r, rt<<1|1, ans);
}
void Ask(int d) {
LL ans = 0, now = Q[d].k;
Pair k;
int pos = 0;
while(now) {
if(now < hashs[1]) break;
if(now >= hashs[cnt]) pos = cnt;
else {
pos = std::lower_bound(hashs+1, hashs+cnt+1, now) - hashs;
if(hashs[pos] > now) pos--;
if(pos == 0) break;
}
k = empty;
Query(1, pos, 1, cnt, 1, k);
if(k == empty) break;
ans += (now/k.second) * k.first;
now %= k.second;
}
printf("%lld\n", ans);
}
void Change(int now) {
int pos = std::lower_bound(hashs+1, hashs+cnt+1, p[Q[now].x]) - hashs;
cover(pos, empty, 1, cnt, 1);
num[pos].erase(num[pos].find(w[Q[now].x]));
if(!num[pos].empty()) {
Pair f = std::make_pair( (*(--num[pos].end())), hashs[pos]);
cover(pos, f, 1, cnt, 1);
}
p[Q[now].x] = Q[now].p, w[Q[now].x] = Q[now].w;
pos = std::lower_bound(hashs+1, hashs+cnt+1, p[Q[now].x]) - hashs;
Modify(pos, Pair(Q[now].w, Q[now].p), 1, cnt, 1);
num[pos].insert(Q[now].w);
}
int main() {
freopen("shopping.in","r",stdin);
freopen("shopping.out","w",stdout);
LL opt = 0, x = 0, pos = 0;
Read(n), Read(m);
for(int i = 1; i <= n; i++) Read(w[i]), Read(p[i]), hashs[++cnt] = p[i];
for(int i = 1; i <= m; i++) {
Read(opt);
if(opt == 1) {
Q[i].opt = 1, Read(Q[i].x), Read(Q[i].w), Read(Q[i].p);
hashs[++cnt] = Q[i].p;
}
else Q[i].opt = 2, Read(Q[i].k);
}
std::sort(hashs+1, hashs+cnt+1);
cnt = std::unique(hashs+1, hashs+cnt+1) - hashs - 1;
for(int i = 1; i <= n; i++) {
pos = std::lower_bound(hashs+1, hashs+cnt+1, p[i]) - hashs;
Modify(pos, std::make_pair(w[i], p[i]), 1, cnt, 1);
num[pos].insert(w[i]);
}
for(int i = 1; i <= m; i++) {
if(Q[i].opt == 1) Change(i);
else Ask(i);
}
return 0;
}
|
tcak76/j2objc
|
Headers/javax/annotation/meta/TypeQualifierValidator.h
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: /Users/tball/tmp/j2objc/jsr305/build_result/java/javax/annotation/meta/TypeQualifierValidator.java
//
#include "../../../J2ObjC_header.h"
#pragma push_macro("INCLUDE_ALL_JavaxAnnotationMetaTypeQualifierValidator")
#ifdef RESTRICT_JavaxAnnotationMetaTypeQualifierValidator
#define INCLUDE_ALL_JavaxAnnotationMetaTypeQualifierValidator 0
#else
#define INCLUDE_ALL_JavaxAnnotationMetaTypeQualifierValidator 1
#endif
#undef RESTRICT_JavaxAnnotationMetaTypeQualifierValidator
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#if !defined (JavaxAnnotationMetaTypeQualifierValidator_) && (INCLUDE_ALL_JavaxAnnotationMetaTypeQualifierValidator || defined(INCLUDE_JavaxAnnotationMetaTypeQualifierValidator))
#define JavaxAnnotationMetaTypeQualifierValidator_
@class IOSObjectArray;
@class JavaxAnnotationMetaWhen;
@protocol JavaLangAnnotationAnnotation;
#if __has_feature(nullability)
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wnullability-completeness"
#endif
@protocol JavaxAnnotationMetaTypeQualifierValidator < NSObject, JavaObject >
/*!
@brief Given a type qualifier, check to see if a known specific constant value
is an instance of the set of values denoted by the qualifier.
@param annotation
the type qualifier
@param value
the value to check
@return a value indicating whether or not the value is an member of the
values denoted by the type qualifier
*/
- (JavaxAnnotationMetaWhen * __nonnull)forConstantValueWithJavaLangAnnotationAnnotation:(id<JavaLangAnnotationAnnotation> __nonnull)annotation
withId:(id)value;
@end
J2OBJC_EMPTY_STATIC_INIT(JavaxAnnotationMetaTypeQualifierValidator)
J2OBJC_TYPE_LITERAL_HEADER(JavaxAnnotationMetaTypeQualifierValidator)
#if __has_feature(nullability)
#pragma clang diagnostic pop
#endif
#endif
#pragma clang diagnostic pop
#pragma pop_macro("INCLUDE_ALL_JavaxAnnotationMetaTypeQualifierValidator")
|
thiagozanetti/barracao-digital
|
lib/errors/api/index.js
|
import BadRequestError from './bad-request'
import ForbiddenError from './forbidden'
import InternalServerError from './internal-server-error'
import MethodNotAllowedError from './method-not-allowed'
import ConflictError from './conflict'
import NotFoundError from './not-found'
import NotImplementedError from './not-implemented'
import UnauthorizedError from './unauthorized'
export {
BadRequestError,
ForbiddenError,
InternalServerError,
MethodNotAllowedError,
ConflictError,
NotFoundError,
NotImplementedError,
UnauthorizedError,
}
|
mtlynch/pyrestic
|
restic/restic_test.py
|
import unittest
from unittest import mock
import restic
from restic.internal import generate
# Ignore suggestions to turn methods into functions.
# pylint: disable=R0201
class ResticTest(unittest.TestCase):
def setUp(self):
self.original_binary = restic.binary_path
self.original_repository = restic.repository
self.original_password_file = restic.password_file
def tearDown(self):
restic.binary_path = self.original_binary
restic.repository = self.original_repository
restic.password_file = self.original_password_file
@mock.patch.object(generate.command_executor, 'execute')
def test_can_change_restic_binary_path(self, mock_execute):
restic.binary_path = '/dummy/path/to/restic-binary'
restic.generate()
mock_execute.assert_called_with(
['/dummy/path/to/restic-binary', '--json', 'generate'])
@mock.patch.object(generate.command_executor, 'execute')
def test_can_set_repository_path(self, mock_execute):
mock_execute.return_value = (
'created restic repository 054ed643d8 at /media/backup1')
restic.repository = '/dummy/repo/path'
restic.init()
mock_execute.assert_called_with(
['restic', '--json', '--repo', '/dummy/repo/path', 'init'])
@mock.patch.object(generate.command_executor, 'execute')
def test_can_set_password_file(self, mock_execute):
mock_execute.return_value = (
'created restic repository 054ed643d8 at /media/backup1')
restic.password_file = '<PASSWORD>'
restic.init()
mock_execute.assert_called_with(
['restic', '--json', '--password-file', 'secret-<PASSWORD>', 'init'])
|
MarginC/kame
|
netbsd/sys/arch/pc532/dev/scnvar.h
|
/* $NetBSD: scnvar.h,v 1.3 1997/03/13 10:24:16 matthias Exp $ */
/*
* Copyright (c) 1996, 1997 <NAME>.
* Copyright (c) 1993 <NAME>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by <NAME>.
* 4. The name of <NAME> may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY <NAME> ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL <NAME> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* scnvar.h: definitions for pc532 2681/2692/26c96 duart driver
*/
/* Constants. */
#ifdef COMDEF_SPEED
#undef TTYDEF_SPEED
#define TTYDEF_SPEED COMDEF_SPEED /* default baud rate */
#endif
#define SCN_FIRST_ADR 0x28000000 /* address of first RS232 port */
#define SCN_FIRST_MAP_ADR 0xFFC80000 /* mapped address of first port */
#define SCN_SIZE 0x8 /* address space for port */
#define SCN_CONSOLE 0 /* minor number of console */
#define SCN_CON_MAP_STAT 0xFFC80001 /* raw addresses for console */
#define SCN_CON_MAP_DATA 0xFFC80003 /* Mapped .... */
#define SCN_CON_MAP_ISR 0xFFC80005
#define SCN_CON_STAT 0x28000001 /* raw addresses for console */
#define SCN_CON_DATA 0x28000003 /* Unmapped .... */
#define SCN_CON_ISR 0x28000005
/* output port bits */
#define OP_RTSA OP_OP0
#define OP_RTSB OP_OP1
#define OP_DTRA OP_OP2
#define OP_DTRB OP_OP3
/* OP4-7 not connected */
/* input port bits */
#define IP_CTSA IP_IP0
#define IP_CTSB IP_IP1
#define IP_DCDB IP_IP2
#define IP_DCDA IP_IP3
/* IP4-6 not connected */
#define ACR_DELTA_CTSA ACR_DELTA_IP0
#define ACR_DELTA_CTSB ACR_DELTA_IP1
#define ACR_DELTA_DCDB ACR_DELTA_IP2
#define ACR_DELTA_DCDA ACR_DELTA_IP3
#define IPCR_CTSA IPCR_IP0
#define IPCR_CTSB IPCR_IP1
#define IPCR_DCDB IPCR_IP2
#define IPCR_DCDA IPCR_IP3
#define IPCR_DELTA_CTSA IPCR_DELTA_IP0
#define IPCR_DELTA_CTSB IPCR_DELTA_IP1
#define IPCR_DELTA_DCDB IPCR_DELTA_IP2
#define IPCR_DELTA_DCDA IPCR_DELTA_IP3
#define SCN_OP_BIS(SC,VAL) ((SC)->sc_duart->base[DU_OPSET] = (VAL))
#define SCN_OP_BIC(SC,VAL) ((SC)->sc_duart->base[DU_OPCLR] = (VAL))
#define SCN_DCD(SC) (((SC)->sc_duart->base[DU_IP] & (SC)->sc_ip_dcd) == 0)
/* pc532 duarts are auto-sized to byte-wide */
#define CH_SZ 8
#define DUART_SZ 16
#define SCN_REG(n) (n) /* n'th reg at n'th byte!! */
/* The DUART description struct; for data common to both channels */
struct duart {
volatile u_char *base;
struct chan {
int32_t ispeed, ospeed;
u_char icode, ocode;
u_char mr0; /* MR0[7:3] */
u_char new_mr1; /* held changes */
u_char new_mr2; /* held changes */
} chan[2];
enum scntype { SCNUNK, SCN2681, SCN2692, SC26C92 } type;
u_int16_t counter; /* C/T generated bps, or zero */
u_int16_t ocounter; /* last C/T generated bps, or zero */
u_char mode; /* ACR[7] + MR0[2:0] */
u_char acr; /* ACR[6:0]*/
u_char imr; /* IMR bits */
u_char opcr; /* OPCR bits */
};
#define SCN_RING_BITS 9 /* 512 byte buffers */
#define SCN_RING_SIZE (1<<SCN_RING_BITS) /* must be a power of two */
#define SCN_RING_MASK (SCN_RING_SIZE-1)
#define SCN_RING_THRESH (SCN_RING_SIZE/2)
#define SCN_RING_HIWAT (SCN_RING_SIZE - (SCN_RING_SIZE >> 2))
/* scn channel state */
struct scn_softc {
struct device sc_dev;
struct tty *sc_tty;
int sc_unit; /* unit number of this line (base 0) */
struct duart *sc_duart; /* pointer to duart struct */
volatile u_char *sc_chbase; /* per-channel registers (CH_xxx) */
u_char sc_swflags; /* from config / TIOCxFLAGS */
#define SCN_SW_SOFTCAR 0x01
#define SCN_SW_CLOCAL 0x02
#define SCN_SW_CRTSCTS 0x04
#define SCN_SW_MDMBUF 0x08 /* not implemented */
/* I wish there was a TS_DIALOUT flag! */
u_char sc_dialout; /* set if open for dialout */
#define SCN_DIALOUT(SCN) ((SCN)->sc_dialout)
#define SCN_SETDIALOUT(SCN) (SCN)->sc_dialout = 1
#define SCN_CLRDIALOUT(SCN) (SCN)->sc_dialout = 0
u_char sc_heldchanges; /* waiting for output done */
/* bits in input port register */
u_char sc_ip_dcd;
u_char sc_ip_cts;
/* bits in output port registers */
u_char sc_op_rts;
u_char sc_op_dtr;
/* interrupt mask bits */
u_char sc_tx_int;
/* counters */
u_long sc_framing_errors;
u_long sc_parity_errors;
u_long sc_fifo_overruns;
u_long sc_breaks;
/* ring buffer for rxrdy interrupt */
u_int sc_rbget; /* ring buffer `get' index */
volatile u_int sc_rbput; /* ring buffer `put' index */
int sc_rbhiwat;
short sc_rbuf[SCN_RING_SIZE]; /* status + data */
long sc_fotime; /* last fifo overrun message */
long sc_rotime; /* last ring overrun message */
u_long sc_ring_overruns; /* number of ring buffer overruns */
/* Flags to communicate with scntty_softint() */
volatile char sc_rx_blocked; /* input block at ring */
};
|
budabum/screen-object
|
src/main/java/al/qa/so/utils/recorder/StepDecorator.java
|
package al.qa.so.utils.recorder;
/**
* @author <NAME>.
*/
public interface StepDecorator {
default String onScreen(Object...args){
return String.format("On screen %s", args);
}
default String actionCall(Object...args){
return String.format("Do action %s(%s)", args);
}
default String transitionCall(Object...args){
return String.format("Do transition '%s' from %s", args);
}
default String transitionExpectation(Object...args){
return String.format(" ... expecting to be on %s", args);
}
default String performCheck(Object...args){
return String.format("Check %s", args);
}
default String driverInteraction(Object...args){
return String.format("%s %s", args);
}
default String driverInteractionCheck(Object...args){
return String.format("... expecting that %s %s", args);
}
}
|
rydockman/YouPick
|
node_modules/@iconify-icons/clarity/src/refresh-line.js
|
<filename>node_modules/@iconify-icons/clarity/src/refresh-line.js
let data = {
"body": "<path class=\"clr-i-outline clr-i-outline-path-1\" d=\"M22.4 11.65a1.09 1.09 0 0 0 1.09 1.09h10.94V1.81a1.09 1.09 0 1 0-2.19 0v7.14a16.41 16.41 0 1 0 1.47 15.86a1.12 1.12 0 0 0-2.05-.9a14.18 14.18 0 1 1-1.05-13.36H23.5a1.09 1.09 0 0 0-1.1 1.1z\" fill=\"currentColor\"/>",
"width": 36,
"height": 36
};
export default data;
|
maying0505/erp_pc
|
src/page/reimburse/assets/index.js
|
export const ApplyListAsset = {
img: {
titleIcon: require('./img/titleIcon.png'),
},
};
|
yan0908/client
|
shared/ios/Pods/Headers/Public/rn-fetch-blob/RNFetchBlobNetwork.h
|
../../../../../node_modules/rn-fetch-blob/ios/RNFetchBlobNetwork.h
|
Freakey17/teiid
|
client/src/main/java/org/teiid/client/BatchSerializer.java
|
/*
* Copyright Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags and
* the COPYRIGHT.txt file distributed with this work.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.teiid.client;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.ObjectStreamConstants;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Array;
import java.sql.SQLException;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.types.ArrayImpl;
import org.teiid.core.types.BinaryType;
import org.teiid.core.types.BlobType;
import org.teiid.core.types.ClobType;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.types.GeographyType;
import org.teiid.core.types.GeometryType;
import org.teiid.core.types.JsonType;
import org.teiid.core.types.XMLType;
import org.teiid.jdbc.JDBCPlugin;
/**
* @since 4.2
*
* <ul>
* <li>version 0: starts with 7.1 and uses simple serialization too broadly
* <li>version 1: starts with 8.0 uses better string, blob, clob, xml, etc.
* add varbinary support.
* however was possibly silently truncating date/time values that were
* outside of jdbc allowed values
* <li>version 2: starts with 8.2 and adds better array serialization and
* uses a safer date/time serialization
* <li>version 3: starts with 8.6 and adds better repeated string performance
* <li>version 4: starts with 8.10 and adds the geometry type
* <li>version 5: starts with 11.2 and adds the geography and json types
* </ul>
*/
public class BatchSerializer {
public static final byte VERSION_GEOMETRY = (byte)4;
public static final byte VERSION_GEOGRAPHY = (byte)5;
static final byte CURRENT_VERSION = VERSION_GEOGRAPHY;
private BatchSerializer() {} // Uninstantiable
private static ColumnSerializer defaultSerializer = new ColumnSerializer();
private static final Map<String, ColumnSerializer[]> serializers = new HashMap<String, ColumnSerializer[]>(128);
static {
serializers.put(DataTypeManager.DefaultDataTypes.BIG_DECIMAL, new ColumnSerializer[] {new BigDecimalColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.BIG_INTEGER, new ColumnSerializer[] {new BigIntegerColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.BOOLEAN, new ColumnSerializer[] {new BooleanColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.BYTE, new ColumnSerializer[] {new ByteColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.CHAR, new ColumnSerializer[] {new CharColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.DATE, new ColumnSerializer[] {new DateColumnSerializer(), new DateColumnSerializer1(), new DateColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.DOUBLE, new ColumnSerializer[] {new DoubleColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.FLOAT, new ColumnSerializer[] {new FloatColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.INTEGER, new ColumnSerializer[] {new IntColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.LONG, new ColumnSerializer[] {new LongColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.SHORT, new ColumnSerializer[] {new ShortColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.TIME, new ColumnSerializer[] {new TimeColumnSerializer(), new TimeColumnSerializer1(), new TimeColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.TIMESTAMP, new ColumnSerializer[] {new TimestampColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.STRING, new ColumnSerializer[] {defaultSerializer, new StringColumnSerializer1(), new StringColumnSerializer1(), new StringColumnSerializer3()});
serializers.put(DataTypeManager.DefaultDataTypes.CLOB, new ColumnSerializer[] {defaultSerializer, new ClobColumnSerializer1()});
serializers.put(DataTypeManager.DefaultDataTypes.JSON, new ColumnSerializer[] {defaultSerializer, new ClobColumnSerializer1(), new ClobColumnSerializer1(), new ClobColumnSerializer1(), new ClobColumnSerializer1(), new JsonColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.BLOB, new ColumnSerializer[] {defaultSerializer, new BlobColumnSerializer1()});
serializers.put(DataTypeManager.DefaultDataTypes.GEOMETRY, new ColumnSerializer[] {defaultSerializer, new GeometryColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.GEOGRAPHY, new ColumnSerializer[] {defaultSerializer, new GeographyColumnSerializer()});
serializers.put(DataTypeManager.DefaultDataTypes.XML, new ColumnSerializer[] {defaultSerializer, new XmlColumnSerializer1()});
serializers.put(DataTypeManager.DefaultDataTypes.NULL, new ColumnSerializer[] {defaultSerializer, new NullColumnSerializer1()});
serializers.put(DataTypeManager.DefaultDataTypes.OBJECT, new ColumnSerializer[] {defaultSerializer, new ObjectColumnSerializer((byte)1)});
serializers.put(DataTypeManager.DefaultDataTypes.VARBINARY, new ColumnSerializer[] {new BinaryColumnSerializer(), new BinaryColumnSerializer1()});
}
private static ColumnSerializer arrayColumnSerializer = new ColumnSerializer() {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version)
throws IOException {
try {
super.writeObject(out, ((java.sql.Array)obj).getArray(), cache, version);
} catch (SQLException e) {
throw new IOException(e);
}
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException,
ClassNotFoundException {
return new ArrayImpl((Object[]) in.readObject());
}
};
private static final ColumnSerializer arrayColumnSerialier2 = new ArrayColumnSerializer2(new ObjectColumnSerializer((byte)2));
private static final class ArrayColumnSerializer2 extends ColumnSerializer {
ObjectColumnSerializer ser;
public ArrayColumnSerializer2(ObjectColumnSerializer ser) {
this.ser = ser;
}
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version)
throws IOException {
Object[] values = null;
try {
values = (Object[]) ((Array)obj).getArray();
} catch (SQLException e) {
out.writeInt(-1);
return;
}
out.writeInt(values.length);
int code = DataTypeManager.getTypeCode(values.getClass().getComponentType());
if ((code == DataTypeManager.DefaultTypeCodes.GEOMETRY && version < VERSION_GEOMETRY)
|| (code == DataTypeManager.DefaultTypeCodes.GEOGRAPHY && version < VERSION_GEOGRAPHY)){
code = DataTypeManager.DefaultTypeCodes.BLOB;
} else if ((code == DataTypeManager.DefaultTypeCodes.JSON && version < VERSION_GEOGRAPHY)){
code = DataTypeManager.DefaultTypeCodes.CLOB;
}
out.writeByte((byte)code);
for (int i = 0; i < values.length;) {
writeIsNullData(out, i, values);
int end = Math.min(values.length, i+8);
for (; i < end; i++) {
if (values[i] != null) {
this.ser.writeObject(out, values[i], code, cache, version);
}
}
}
out.writeBoolean((obj instanceof ArrayImpl && ((ArrayImpl)obj).isZeroBased()));
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException,
ClassNotFoundException {
int length = in.readInt();
if (length == -1) {
return new ArrayImpl(null);
}
int code = in.readByte();
Object[] vals = (Object[])java.lang.reflect.Array.newInstance(DataTypeManager.getClass(code), length);
for (int i = 0; i < length;) {
byte b = in.readByte();
int end = Math.min(length, i+8);
for (; i < end; i++) {
if (!isNullObject(i, b)) {
vals[i] = this.ser.readObject(in, cache, code, version);
}
}
}
ArrayImpl result = new ArrayImpl(vals);
result.setZeroBased(in.readBoolean());
return result;
}
@Override
public boolean usesCache(byte version) {
return version >= 3;
}
}
static class BinaryColumnSerializer1 extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version)
throws IOException {
byte[] bytes = ((BinaryType)obj).getBytes();
out.writeInt(bytes.length); //in theory this could be a short, but we're not strictly enforcing the length
out.write(bytes);
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException,
ClassNotFoundException {
int length = in.readInt();
byte[] bytes = new byte[length];
in.readFully(bytes);
return new BinaryType(bytes);
}
}
static class BinaryColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version)
throws IOException {
//uses object serialization for compatibility with legacy clients
super.writeObject(out, ((BinaryType)obj).getBytesDirect(), cache, version);
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException,
ClassNotFoundException {
//won't actually be used
byte[] bytes = (byte[])super.readObject(in, cache, version);
return new BinaryType(bytes);
}
}
public static final class ObjectColumnSerializer extends ColumnSerializer {
byte defaultVersion;
public ObjectColumnSerializer(byte version) {
this.defaultVersion = version;
}
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version)
throws IOException {
int code = DataTypeManager.getTypeCode(obj.getClass());
if (code == DataTypeManager.DefaultTypeCodes.GEOMETRY) {
if (version < VERSION_GEOMETRY) {
code = DataTypeManager.DefaultTypeCodes.BLOB;
}
} else if (code == DataTypeManager.DefaultTypeCodes.GEOGRAPHY) {
if (version < VERSION_GEOGRAPHY) {
code = DataTypeManager.DefaultTypeCodes.BLOB;
}
}
out.writeByte((byte)code);
writeObject(out, obj, code, cache, version<VERSION_GEOMETRY?this.defaultVersion:version);
}
protected void writeObject(ObjectOutput out, Object obj, int code, Map<Object, Integer> cache, byte effectiveVersion)
throws IOException {
if (code == DataTypeManager.DefaultTypeCodes.BOOLEAN) {
if (Boolean.TRUE.equals(obj)) {
out.write((byte)1);
} else {
out.write((byte)0);
}
} else if (code == DataTypeManager.DefaultTypeCodes.OBJECT) {
super.writeObject(out, obj, cache, effectiveVersion);
} else {
String name = DataTypeManager.getDataTypeName(obj.getClass());
ColumnSerializer s = getSerializer(name, effectiveVersion);
s.writeObject(out, obj, cache, effectiveVersion);
}
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException,
ClassNotFoundException {
int code = in.readByte();
return readObject(in, cache, code, version<VERSION_GEOMETRY?this.defaultVersion:version);
}
private Object readObject(ObjectInput in, List<Object> cache, int code, byte effectiveVersion) throws IOException,
ClassNotFoundException {
if (code == DataTypeManager.DefaultTypeCodes.BOOLEAN) {
if (in.readByte() == (byte)0) {
return Boolean.FALSE;
}
return Boolean.TRUE;
}
if (code != DataTypeManager.DefaultTypeCodes.OBJECT) {
ColumnSerializer s = getSerializer(DataTypeManager.getDataTypeName(DataTypeManager.getClass(code)), effectiveVersion);
return s.readObject(in, cache, effectiveVersion);
}
return super.readObject(in, cache, effectiveVersion);
}
@Override
public boolean usesCache(byte version) {
return version >= 3;
}
}
private static final int MAX_UTF = 0xFFFF/3; //this is greater than the expected max length of Teiid Strings
private static class StringColumnSerializer1 extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
String str = (String)obj;
if (str.length() <= MAX_UTF) {
//skip object serialization if we have a short string
out.writeByte(ObjectStreamConstants.TC_STRING);
out.writeUTF(str);
} else {
out.writeByte(ObjectStreamConstants.TC_LONGSTRING);
out.writeObject(obj);
}
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException,
ClassNotFoundException {
if (in.readByte() == ObjectStreamConstants.TC_STRING) {
return in.readUTF();
}
return super.readObject(in, cache, version);
}
}
private static class StringColumnSerializer3 extends StringColumnSerializer1 {
private static final int MAX_INLINE_STRING_LENGTH = 5;
private static final byte REPEATED_STRING = 0;
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version)
throws IOException, ClassNotFoundException {
byte b = in.readByte();
if (b == ObjectStreamConstants.TC_STRING) {
String val = in.readUTF();
if (val.length() > MAX_INLINE_STRING_LENGTH) {
cache.add(val);
}
return val;
}
if (b == REPEATED_STRING) {
Integer val = in.readInt();
return cache.get(val);
}
String val = (String) in.readObject();
if (val.length() > MAX_INLINE_STRING_LENGTH) {
cache.add(val);
}
return val;
}
@Override
protected void writeObject(ObjectOutput out, Object obj,
Map<Object, Integer> cache, byte version) throws IOException {
String str = (String)obj;
Integer val = cache.get(str);
if (val != null) {
out.writeByte(REPEATED_STRING);
out.writeInt(val);
return;
}
if (str.length() > MAX_INLINE_STRING_LENGTH) {
cache.put(str, cache.size());
}
super.writeObject(out, obj, cache, version);
}
@Override
public boolean usesCache(byte version) {
return true;
}
}
private static class NullColumnSerializer1 extends ColumnSerializer {
@Override
public void writeColumn(ObjectOutput out, int col,
List<? extends List<?>> batch, Map<Object, Integer> cache, byte version) throws IOException {
}
@Override
public void readColumn(ObjectInput in, int col,
List<List<Object>> batch, byte[] isNull, List<Object> cache, byte version) throws IOException,
ClassNotFoundException {
}
}
private static class ClobColumnSerializer1 extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
((Externalizable)obj).writeExternal(out);
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException, ClassNotFoundException {
ClobType ct = new ClobType();
ct.readExternal(in);
return ct;
}
}
private static class JsonColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
((Externalizable)obj).writeExternal(out);
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException, ClassNotFoundException {
JsonType ct = new JsonType();
ct.readExternal(in);
return ct;
}
}
private static class BlobColumnSerializer1 extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
((Externalizable)obj).writeExternal(out);
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException, ClassNotFoundException {
BlobType bt = new BlobType();
bt.readExternal(in);
return bt;
}
}
private static class GeometryColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
((Externalizable)obj).writeExternal(out);
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException, ClassNotFoundException {
if (version < VERSION_GEOMETRY) {
BlobType bt = new BlobType();
bt.readExternal(in);
return bt;
}
GeometryType bt = new GeometryType();
bt.readExternal(in);
return bt;
}
}
private static class GeographyColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
((Externalizable)obj).writeExternal(out);
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException, ClassNotFoundException {
if (version < VERSION_GEOGRAPHY) {
BlobType bt = new BlobType();
bt.readExternal(in);
return bt;
}
GeographyType bt = new GeographyType();
bt.readExternal(in);
return bt;
}
}
private static class XmlColumnSerializer1 extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
((XMLType)obj).writeExternal(out, (byte) 1);
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException, ClassNotFoundException {
XMLType xt = new XMLType();
xt.readExternal(in, (byte)1);
return xt;
}
}
/**
* Packs the (boolean) information about whether data values in the column are null
* into bytes so that we send ~n/8 instead of n bytes.
* @param out
* @param col
* @param batch
* @throws IOException
* @since 4.2
*/
static void writeIsNullData(ObjectOutput out, int col, List<? extends List<?>> batch) throws IOException {
int numBytes = batch.size() / 8, row = 0, currentByte = 0;
for (int byteNum = 0; byteNum < numBytes; byteNum++, row+=8) {
currentByte = (batch.get(row).get(col) == null) ? 0x80 : 0;
if (batch.get(row+1).get(col) == null) {
currentByte |= 0x40;
}
if (batch.get(row+2).get(col) == null) {
currentByte |= 0x20;
}
if (batch.get(row+3).get(col) == null) {
currentByte |= 0x10;
}
if (batch.get(row+4).get(col) == null) {
currentByte |= 0x08;
}
if (batch.get(row+5).get(col) == null) {
currentByte |= 0x04;
}
if (batch.get(row+6).get(col) == null) {
currentByte |= 0x02;
}
if (batch.get(row+7).get(col) == null) {
currentByte |= 0x01;
}
out.write(currentByte);
}
if (batch.size() % 8 > 0) {
currentByte = 0;
for (int mask = 0x80; row < batch.size(); row++, mask >>= 1) {
if (batch.get(row).get(col) == null) {
currentByte |= mask;
}
}
out.write(currentByte);
}
}
static void writeIsNullData(ObjectOutput out, int offset, Object[] batch) throws IOException {
int currentByte = 0;
for (int mask = 0x80; offset < batch.length; offset++, mask >>= 1) {
if (batch[offset] == null) {
currentByte |= mask;
}
}
out.write(currentByte);
}
/**
* Reads the isNull data into a byte array
* @param in
* @param isNullBytes
* @throws IOException
* @since 4.2
*/
static void readIsNullData(ObjectInput in, byte[] isNullBytes) throws IOException {
for (int i = 0; i < isNullBytes.length; i++) {
isNullBytes[i] = in.readByte();
}
}
/**
* Gets whether a data value is null based on a packed byte array containing boolean data
* @param isNull
* @param row
* @return
* @since 4.2
*/
static final boolean isNullObject(byte[] isNull, int row) {
// byte number mask bits to shift mask
return (isNull [ row / 8 ] & (0x01 << (7 - (row % 8)))) != 0;
}
private static final boolean isNullObject(int row, byte b) {
return (b & (0x01 << (7 - (row % 8)))) != 0;
}
/**
* An abstract serializer for native types
* @since 4.2
*/
private static class ColumnSerializer {
public void writeColumn(ObjectOutput out, int col, List<? extends List<?>> batch, Map<Object, Integer> cache, byte version) throws IOException {
writeIsNullData(out, col, batch);
Object obj = null;
for (int i = 0; i < batch.size(); i++) {
obj = batch.get(i).get(col);
if (obj != null) {
writeObject(out, obj, cache, version);
}
}
}
public void readColumn(ObjectInput in, int col, List<List<Object>> batch, byte[] isNull, List<Object> cache, byte version) throws IOException, ClassNotFoundException {
readIsNullData(in, isNull);
for (int i = 0; i < batch.size(); i++) {
if (!isNullObject(isNull, i)) {
batch.get(i).set(col, DataTypeManager.getCanonicalValue(readObject(in, cache, version)));
}
}
}
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
out.writeObject(obj);
}
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException, ClassNotFoundException {
return in.readObject();
}
public boolean usesCache(byte version) {
return false;
}
}
private static class IntColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
out.writeInt(((Integer)obj).intValue());
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException {
return Integer.valueOf(in.readInt());
}
}
private static class LongColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
out.writeLong(((Long)obj).longValue());
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException {
return Long.valueOf(in.readLong());
}
}
private static class FloatColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
out.writeFloat(((Float)obj).floatValue());
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException {
return new Float(in.readFloat());
}
}
private static class DoubleColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
out.writeDouble(((Double)obj).doubleValue());
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException {
return new Double(in.readDouble());
}
}
private static class ShortColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
out.writeShort(((Short)obj).shortValue());
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException {
return Short.valueOf(in.readShort());
}
}
private static class BooleanColumnSerializer extends ColumnSerializer {
/* This implementation compacts the isNull and boolean data for non-null values into a byte[]
* by using a 8 bit mask that is bit-shifted to mask each value.
*/
@Override
public void writeColumn(ObjectOutput out, int col, List<? extends List<?>> batch, Map<Object, Integer> cache, byte version) throws IOException {
int currentByte = 0;
int mask = 0x80;
Object obj;
for (int row = 0; row < batch.size(); row++) {
// Write the isNull value
obj = batch.get(row).get(col);
if (obj == null ) {
currentByte |= mask;
}
mask >>= 1; // Shift the mask to the next bit
if (mask == 0) {
// If the current byte has been used up, write it and reset.
out.write(currentByte);
currentByte = 0;
mask = 0x80;
}
if (obj != null) {
// Write the boolean value if it's not null
if (((Boolean)obj).booleanValue()) {
currentByte |= mask;
}
mask >>= 1;
if (mask == 0) {
out.write(currentByte);
currentByte = 0;
mask = 0x80;
}
}
}
// Invariant mask != 0
// If we haven't reached the eight-row mark then the loop would not have written this byte
// Write the final byte containing data for the extra rows, if it exists.
if (mask != 0x80) {
out.write(currentByte);
}
}
@Override
public void readColumn(ObjectInput in, int col,
List<List<Object>> batch, byte[] isNull, List<Object> cache, byte version) throws IOException,
ClassNotFoundException {
int currentByte = 0, mask = 0; // Initialize the mask so that it is reset in the loop
boolean isNullVal;
for (int row = 0; row < batch.size(); row++) {
if (mask == 0) {
// If we used up the byte, read the next one, and reset the mask
currentByte = in.read();
mask = 0x80;
}
isNullVal = (currentByte & mask) != 0;
mask >>= 1; // Shift the mask to the next bit
if (!isNullVal) {
if (mask == 0) {
currentByte = in.read();
mask = 0x80;
}
batch.get(row).set(col, ((currentByte & mask) == 0) ? Boolean.FALSE : Boolean.TRUE);
mask >>= 1;
}
}
}
}
private static class ByteColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
out.writeByte(((Byte)obj).byteValue());
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException {
return Byte.valueOf(in.readByte());
}
}
private static class CharColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
out.writeChar(((Character)obj).charValue());
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException {
return Character.valueOf(in.readChar());
}
}
private static class BigIntegerColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
BigInteger val = (BigInteger)obj;
byte[] bytes = val.toByteArray();
out.writeInt(bytes.length);
out.write(bytes);
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException {
int length = in.readInt();
byte[] bytes = new byte[length];
in.readFully(bytes);
return new BigInteger(bytes);
}
}
private static class BigDecimalColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
BigDecimal val = (BigDecimal)obj;
out.writeInt(val.scale());
BigInteger unscaled = val.unscaledValue();
byte[] bytes = unscaled.toByteArray();
out.writeInt(bytes.length);
out.write(bytes);
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException {
int scale = in.readInt();
int length = in.readInt();
byte[] bytes = new byte[length];
in.readFully(bytes);
return new BigDecimal(new BigInteger(bytes), scale);
}
}
private static class DateColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
out.writeLong(((java.sql.Date)obj).getTime());
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException {
return new java.sql.Date(in.readLong());
}
}
private static class TimeColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
out.writeLong(((Time)obj).getTime());
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException {
return new Time(in.readLong());
}
}
static int DATE_NORMALIZER = 0;
public final static long MIN_DATE_32;
public final static long MAX_DATE_32;
public final static long MIN_TIME_32;
public final static long MAX_TIME_32;
static {
Calendar c = Calendar.getInstance();
c.setTimeZone(TimeZone.getTimeZone("GMT")); //$NON-NLS-1$
c.set(1900, 0, 1, 0, 0, 0);
c.set(Calendar.MILLISECOND, 0);
MIN_DATE_32 = c.getTimeInMillis();
MAX_DATE_32 = MIN_DATE_32 + ((1l<<32)-1)*60000;
DATE_NORMALIZER = -(int)(MIN_DATE_32/60000); //support a 32 bit range starting at this value
MAX_TIME_32 = Integer.MAX_VALUE*1000l;
MIN_TIME_32 = Integer.MIN_VALUE*1000l;
}
private static class DateColumnSerializer1 extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
long time = ((java.sql.Date)obj).getTime();
if (time < MIN_DATE_32 || time > MAX_DATE_32) {
throw new IOException(JDBCPlugin.Util.gs(JDBCPlugin.Event.TEIID20029, obj.getClass().getName()));
}
out.writeInt((int)(time/60000) + DATE_NORMALIZER);
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException {
return new java.sql.Date(((in.readInt()&0xffffffffL) - DATE_NORMALIZER)*60000);
}
}
private static class TimeColumnSerializer1 extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
long time = ((Time)obj).getTime();
if (time < MIN_TIME_32 || time > MAX_TIME_32) {
throw new IOException(JDBCPlugin.Util.gs(JDBCPlugin.Event.TEIID20029, obj.getClass().getName()));
}
out.writeInt((int)(time/1000));
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException {
return new Time((in.readInt()&0xffffffffL)*1000);
}
}
private static class TimestampColumnSerializer extends ColumnSerializer {
@Override
protected void writeObject(ObjectOutput out, Object obj, Map<Object, Integer> cache, byte version) throws IOException {
Timestamp ts = (Timestamp)obj;
out.writeLong(ts.getTime());
out.writeInt(ts.getNanos());
}
@Override
protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException {
Timestamp ts = new Timestamp(in.readLong());
ts.setNanos(in.readInt());
return ts;
}
}
private static ColumnSerializer getSerializer(String type, byte version) {
ColumnSerializer[] sers = serializers.get(type);
if (sers == null) {
if (DataTypeManager.isArrayType(type)) {
if (version < 2) {
return arrayColumnSerializer;
}
return arrayColumnSerialier2;
}
return defaultSerializer;
}
return sers[Math.min(version, sers.length - 1)];
}
public static void writeBatch(ObjectOutput out, String[] types, List<? extends List<?>> batch) throws IOException {
writeBatch(out, types, batch, CURRENT_VERSION);
}
public static void writeBatch(ObjectOutput out, String[] types, List<? extends List<?>> batch, byte version) throws IOException {
if (batch == null) {
out.writeInt(-1);
} else {
if (version > 0 && batch.size() > 0) {
out.writeInt(-batch.size() -1);
out.writeByte(version);
} else {
out.writeInt(batch.size());
}
if (batch.size() > 0) {
int columns = types.length;
out.writeInt(columns);
Map<Object, Integer> cache = null;
for(int i = 0; i < columns; i++) {
ColumnSerializer serializer = getSerializer(types[i], version);
if (cache == null && serializer.usesCache(version)) {
cache = new HashMap<Object, Integer>();
}
try {
serializer.writeColumn(out, i, batch, cache, version);
} catch (ClassCastException e) {
Object obj = null;
String objectClass = null;
objectSearch: for (int row = 0; row < batch.size(); row++) {
obj = batch.get(row).get(i);
if (obj != null) {
objectClass = obj.getClass().getName();
break objectSearch;
}
}
throw new TeiidRuntimeException(JDBCPlugin.Event.TEIID20001, e, JDBCPlugin.Util.gs(JDBCPlugin.Event.TEIID20001, new Object[] {types[i], new Integer(i), objectClass}));
}
}
}
}
}
public static List<List<Object>> readBatch(ObjectInput in, String[] types) throws IOException, ClassNotFoundException {
int rows = 0;
try {
rows = in.readInt();
} catch (IOException e) {
//7.4 compatibility
if (types == null || types.length == 0) {
List<Object>[] result = (List[])in.readObject();
ArrayList<List<Object>> batch = new ArrayList<List<Object>>();
batch.addAll(Arrays.asList(result));
return batch;
}
throw e;
}
if (rows == 0) {
return new ArrayList<List<Object>>(0);
}
if (rows == -1) {
return null;
}
byte version = (byte)0;
if (rows < 0) {
rows = -(rows+1);
version = in.readByte();
}
int columns = in.readInt();
List<List<Object>> batch = new ResizingArrayList<List<Object>>(rows);
int numBytes = rows/8;
int extraRows = rows % 8;
for (int currentRow = 0; currentRow < rows; currentRow++) {
batch.add(currentRow, Arrays.asList(new Object[columns]));
}
byte[] isNullBuffer = new byte[(extraRows > 0) ? numBytes + 1: numBytes];
List<Object> cache = null;
for (int col = 0; col < columns; col++) {
ColumnSerializer serializer = getSerializer(types[col], version);
if (cache == null && serializer.usesCache(version)) {
cache = new ArrayList<Object>();
}
serializer.readColumn(in, col, batch, isNullBuffer, cache, version);
}
return batch;
}
public static String getClientSafeType(String type,
byte clientSerializationVersion) {
if (clientSerializationVersion == CURRENT_VERSION) {
return type;
}
if (DataTypeManager.isArrayType(type)) {
return getClientSafeType(DataTypeManager.getComponentType(type), clientSerializationVersion) + DataTypeManager.ARRAY_SUFFIX;
}
if (clientSerializationVersion < BatchSerializer.VERSION_GEOMETRY && type.equals(DataTypeManager.DefaultDataTypes.GEOMETRY)) {
return DataTypeManager.DefaultDataTypes.BLOB;
}
if (clientSerializationVersion < BatchSerializer.VERSION_GEOGRAPHY) {
if (type.equals(DataTypeManager.DefaultDataTypes.GEOGRAPHY)) {
return DataTypeManager.DefaultDataTypes.BLOB;
}
if (type.equals(DataTypeManager.DefaultDataTypes.JSON)) {
return DataTypeManager.DefaultDataTypes.CLOB;
}
}
return type;
}
}
|
amelspahic/web-engineering
|
backend/helpers/response.js
|
exports.successResponse = (res, data) => {
return res.status(200).json(data);
};
exports.notFoundResponse = (res, msg) => {
const data = {
message: msg,
};
return res.status(404).json(data);
};
exports.noContentResponse = (res, msg) => {
const data = {
message: msg,
};
return res.status(204).json(data);
};
exports.serverErrorResponse = (res, msg) => {
const data = {
message: msg,
};
return res.status(500).json(data);
};
exports.validationErrorResponse = (res, msg, data) => {
const resData = {
message: msg,
data: data,
};
return res.status(400).json(resData);
};
|
DmitryGerasimenko/jinterval
|
jinterval-rational-java/src/main/java/net/java/jinterval/rational/BinaryDoubleImpl.java
|
/*
* Copyright (c) 2012, JInterval Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.java.jinterval.rational;
import java.math.BigInteger;
/**
*
* @author nadezhin
*/
class BinaryDoubleImpl extends BinaryDouble {
BinaryDoubleImpl(double value) {
super(value);
}
@Override
public int intCeilLog2() {
long bits = Double.doubleToRawLongBits(value);
int p = ((int) (bits >> 52)) & 0x7FF;
assert p != 0x7FF;
if (p != 0) {
return (bits & BinaryValueSet64.SIGNIF_BIT_MASK) != 0 ? p + Double.MIN_EXPONENT : p + (Double.MIN_EXPONENT - 1);
} else {
int leadingZeros = Long.numberOfLeadingZeros((bits & BinaryValueSet64.SIGNIF_BIT_MASK) - 1);
return (Double.MIN_EXPONENT - 52 + 64) - leadingZeros;
}
}
@Override
public int intFloorLog2() {
long bits = Double.doubleToRawLongBits(value);
int p = ((int) (bits >> 52)) & 0x7FF;
assert p != 0x7FF;
if (p != 0) {
return p + (Double.MIN_EXPONENT - 1);
} else {
int leadingZeros = Long.numberOfLeadingZeros((bits & BinaryValueSet64.SIGNIF_BIT_MASK));
return (Double.MIN_EXPONENT - 52 + 64 - 1) - leadingZeros;
}
}
@Override
public int intExp2() {
long bits = Double.doubleToRawLongBits(value);
int p = ((int) (bits >> 52)) & 0x7FF;
assert p != 0x7FF;
int trailingZeros = Long.numberOfTrailingZeros(bits);
if (p != 0) {
return p + Math.min(trailingZeros, 52) + (Double.MIN_EXPONENT - 1 - 52);
} else {
assert trailingZeros < 52;
return trailingZeros + (Double.MIN_EXPONENT - 52);
}
}
@Override
public BigInteger getNumeratorWithout2s() {
long bits = Double.doubleToRawLongBits(value);
int p = ((int) (bits >> 52)) & 0x7FF;
assert p != 0x7FF;
long m = bits & 0xFFFFFFFFFFFFFL;
int trailingZeros = Long.numberOfTrailingZeros(bits);
if (p != 0) {
m |= 0x10000000000000L;
}
m >>>= Math.min(trailingZeros, 52);
if (bits < 0) {
m = -m;
}
return BigInteger.valueOf(m);
}
@Override
public BigInteger getNumeratorWithout2sAbs() {
long bits = Double.doubleToRawLongBits(value);
int p = ((int) (bits >> 52)) & 0x7FF;
assert p != 0x7FF;
long m = bits & 0xFFFFFFFFFFFFFL;
int trailingZeros = Long.numberOfTrailingZeros(bits);
if (p != 0) {
m |= 0x10000000000000L;
}
m >>>= Math.min(trailingZeros, 52);
return BigInteger.valueOf(m);
}
@Override
public int signum() {
return value > 0 ? +1 : -1;
}
@Override
public int compareTo(ExtendedRational that) {
return -that.compareTo(this);
}
@Override
int compareTo(BinaryImpl that) {
return -that.compareTo(this);
}
@Override
int compareTo(BinaryDoubleImpl that) {
return value > that.value ? +1 : value < that.value ? -1 : 0;
}
@Override
public int intValue() {
return (int) value;
}
@Override
public long longValue() {
return (long) value;
}
@Override
int precision() {
long bits = Double.doubleToRawLongBits(value);
int p = (int) ((bits & BinaryValueSet64.EXP_BIT_MASK) >> (BinaryValueSet64.SIGNIFICAND_WIDTH - 1));
assert p != 0x7FF;
int trailingZeros = Long.numberOfTrailingZeros(bits);
if (p != 0) {
return Math.max(1, BinaryValueSet64.SIGNIFICAND_WIDTH - trailingZeros);
}
assert trailingZeros < (BinaryValueSet64.SIGNIFICAND_WIDTH - 1);
return Long.SIZE - Long.numberOfLeadingZeros(bits & BinaryValueSet64.SIGNIF_BIT_MASK) - trailingZeros;
}
}
|
Aghajari/AXAnimation
|
AXAnimation/src/main/java/com/aghajari/axanimation/livevar/LiveSizePoint.java
|
<filename>AXAnimation/src/main/java/com/aghajari/axanimation/livevar/LiveSizePoint.java
/*
* Copyright (C) 2021 - <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.aghajari.axanimation.livevar;
import android.graphics.PointF;
import android.view.Gravity;
import android.view.View;
import androidx.annotation.NonNull;
import java.util.Map;
/**
* It's a {@link android.graphics.PointF} with LiveSize!
*
* @author <NAME>
*/
public class LiveSizePoint implements LiveSizeDebugger {
private float xValue;
private float yValue;
public LiveSize x;
public LiveSize y;
public LiveSizePoint(LiveSize x, LiveSize y) {
this.x = x;
this.y = y;
}
/**
* Set the point's x and y coordinates
*/
public void set(LiveSize x, LiveSize y) {
this.x = x;
this.y = y;
}
/**
* Call this before using {@link #getPointF()}
*/
public void prepare(int viewWidth, int viewHeight,
LayoutSize parent, LayoutSize target, LayoutSize original) {
xValue = x.calculate(viewWidth, viewHeight, parent, target, original, Gravity.CENTER_HORIZONTAL);
yValue = y.calculate(viewWidth, viewHeight, parent, target, original, Gravity.CENTER_VERTICAL);
}
public PointF getPointF() {
return new PointF(xValue, yValue);
}
@Override
public Map<String, String> debugLiveSize(@NonNull View view) {
return LiveSizeDebugHelper.debug(x, y, view, Gravity.CENTER);
}
}
|
CarysT/medusa
|
ThirdParty/bullet-2.75/Extras/COLLADA_DOM/include/dae/daeDocument.h
|
/*
* Copyright 2006 Sony Computer Entertainment Inc.
*
* Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the License at:
* http://research.scea.com/scea_shared_source_license.html
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing permissions and limitations under the
* License.
*/
#ifndef __DAE_DOCUMENT__
#define __DAE_DOCUMENT__
#include <dae/daeTypes.h>
#include <dae/daeElement.h>
#include <dae/daeURI.h>
#include <dae/daeStringRef.h>
/**
* The @c daeDocument class implements a COLLADA runtime database entry.
*/
class daeDocument
{
public:
// sthomas
/**
* Destructor
*/
DLLSPEC ~daeDocument();
/**
* Accessor to get the @c domCollada associated with this document.
* @return A @c daeElementRef for the @c domCollada that is the root of this document.
* @note This function should really return a domColladaRef,
* but we're trying to avoid having @c dae classes depend on generated dom classes.
*/
daeElement* getDomRoot() const {return(dom);}
/**
* Accessor to set the domCollada associated with this document
* @param domRoot the domCollada that is the root of this document
* @remarks Should really require a domColladaRef but we're trying to avoid having dae classes depend on generated dom classes.
*/
void setDomRoot(daeElement* domRoot) {dom = domRoot; domRoot->setDocument(this); }
/**
* Accessor to get the URI associated with the document in this document;
* this is currently set to the URI from which the document was loaded, but
* is blank if the document was created with @c insertDocument().
* @return Returns a pointer to the URI for this document.
* @note This is the full URI of the document and not the document base URI.
*/
daeURI* getDocumentURI() {return (&uri);}
/**
* Const accessor to get the URI associated with the document in this collection;
* this is currently set to the URI from which the collection was loaded, but
* is blank if the collection was created with @c insertCollection().
* @return Returns a pointer to the URI for this collection.
* @note This is the full URI of the document and not the document base URI.
*/
const daeURI* getDocumentURI() const {return (&uri);}
/**
* Accessor to get if this document has been modified since the last time the database was validated.
* @return Returns true if the document was modified, false otherwise.
*/
daeBool getModified() const {return modified;}
/**
* Sets if this document has been modified since the last time the database was validated.
* @param A boolean value specifying if the document was modified.
*/
void setModified( daeBool mod ) { if (!mod) { insertedElements.clear(); removedElements.clear(); } modified = mod;}
/**
* This function is used to track how a document gets modified. It gets called internally.
* @param element The element that was added to this document.
* @note This function is called internally and not meant to be called by the client application.
* Calling this function from the client application may result in unexpected behavior.
*/
DLLSPEC void insertElement( daeElementRef element );
/**
* This function is used to track how a document gets modified. It gets called internally.
* @param element The element that was removed from this document.
* @note This function is called internally and not meant to be called by the client application.
* Calling this function from the client application may result in unexpected behavior.
*/
DLLSPEC void removeElement( daeElementRef element );
/**
* This function is used to track how a document gets modified. It gets called internally.
* @return Returns an array of elements that have been added since the last database update.
*/
const daeElementRefArray &getInsertedArray() const { return insertedElements; }
/**
* This function is used to track how a document gets modified. It gets called internally.
* @return Returns an array of elements that have been removed since the last database update.
*/
const daeElementRefArray &getRemovedArray() const { return removedElements; }
/**
* Adds a URI to the list of external references in this document.
* @param uri The URI that is the external reference.
* @note This function gets called internally from daeURI upon trying to resolve an element.
* Calling this function in your client code my result in unexpected behavior.
*/
DLLSPEC void addExternalReference( daeURI &uri );
/**
* Removes a URI to the list of external references in this document.
* @param uri The URI that was the external reference.
* @note This function gets called internally from daeURI upon trying to resolve an element.
* Calling this function in your client code my result in unexpected behavior.
*/
DLLSPEC void removeExternalReference( daeURI &uri );
/**
* Gets a list of all the documents that are referenced from URI contained within this document.
* @return Returns a list of URI strings, each being a URI which is referenced from within this document.
*/
const daeStringRefArray &getReferencedDocuments() const { return referencedDocuments; }
/**
* Resolves the URIs that reference the document specified by docURI.
* @param docURI The URI string of the document that you want to resolve against.
* @note This function is called internally whenever a new document is loaded.
*/
DLLSPEC void resolveExternals( daeString docURI);
DLLSPEC const daeTArray<daeURI*> *getExternalURIs(daeStringRef docURI) const;
private:
/**
* Top Level element for of the document, always a domCollada
* @remarks This member will eventually be taken private, use getDomRoot() to access it.
*/
daeElementRef dom;
/**
* The URI of the document, may be blank if the document wasn't loaded from a URI
* @remarks This member will eventually be taken private, use getDocumentURI() to access it.
*/
daeURI uri;
/**
* A flag that indicates if this document has been modified.
*/
daeBool modified;
daeElementRefArray insertedElements;
daeElementRefArray removedElements;
daeStringRefArray referencedDocuments;
daeTArray< daeTArray<daeURI*>* > externalURIs;
};
typedef daeDocument daeCollection;
#endif
|
Smashulica/nebula8
|
core/commands/public/staff.py
|
<reponame>Smashulica/nebula8
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright SquirrelNetwork
from core import decorators
from telegram.utils.helpers import mention_markdown
@decorators.public.init
@decorators.delete.init
def init(update,context):
bot = context.bot
administrators = update.effective_chat.get_administrators()
chat = update.effective_chat.id
string = "Group Staff:\n"
for admin in administrators:
user = admin.user
user_first = user.first_name
string += "๐ฎ {}\n".format(mention_markdown(user.id, user_first, version=2))
bot.send_message(chat,string,parse_mode='MarkdownV2')
|
cisco-ie/cisco-proto
|
codegen/go/xr/62x/cisco_ios_xr_ipv4_bgp_oper/bgp/instances/instance/instance_active/default_vrf/afs/af/dampenings/dampening/bgp_path_bag.pb.go
|
/*
Copyright 2019 Cisco Systems
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: bgp_path_bag.proto
package cisco_ios_xr_ipv4_bgp_oper_bgp_instances_instance_instance_active_default_vrf_afs_af_dampenings_dampening
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type BgpPathBag_KEYS struct {
InstanceName string `protobuf:"bytes,1,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"`
AfName string `protobuf:"bytes,2,opt,name=af_name,json=afName,proto3" json:"af_name,omitempty"`
Reuse uint32 `protobuf:"varint,3,opt,name=reuse,proto3" json:"reuse,omitempty"`
Version uint32 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
Rd string `protobuf:"bytes,5,opt,name=rd,proto3" json:"rd,omitempty"`
Network string `protobuf:"bytes,6,opt,name=network,proto3" json:"network,omitempty"`
NeighborAddress string `protobuf:"bytes,7,opt,name=neighbor_address,json=neighborAddress,proto3" json:"neighbor_address,omitempty"`
SourceRd string `protobuf:"bytes,8,opt,name=source_rd,json=sourceRd,proto3" json:"source_rd,omitempty"`
PathId uint32 `protobuf:"varint,9,opt,name=path_id,json=pathId,proto3" json:"path_id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpPathBag_KEYS) Reset() { *m = BgpPathBag_KEYS{} }
func (m *BgpPathBag_KEYS) String() string { return proto.CompactTextString(m) }
func (*BgpPathBag_KEYS) ProtoMessage() {}
func (*BgpPathBag_KEYS) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{0}
}
func (m *BgpPathBag_KEYS) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpPathBag_KEYS.Unmarshal(m, b)
}
func (m *BgpPathBag_KEYS) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpPathBag_KEYS.Marshal(b, m, deterministic)
}
func (m *BgpPathBag_KEYS) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpPathBag_KEYS.Merge(m, src)
}
func (m *BgpPathBag_KEYS) XXX_Size() int {
return xxx_messageInfo_BgpPathBag_KEYS.Size(m)
}
func (m *BgpPathBag_KEYS) XXX_DiscardUnknown() {
xxx_messageInfo_BgpPathBag_KEYS.DiscardUnknown(m)
}
var xxx_messageInfo_BgpPathBag_KEYS proto.InternalMessageInfo
func (m *BgpPathBag_KEYS) GetInstanceName() string {
if m != nil {
return m.InstanceName
}
return ""
}
func (m *BgpPathBag_KEYS) GetAfName() string {
if m != nil {
return m.AfName
}
return ""
}
func (m *BgpPathBag_KEYS) GetReuse() uint32 {
if m != nil {
return m.Reuse
}
return 0
}
func (m *BgpPathBag_KEYS) GetVersion() uint32 {
if m != nil {
return m.Version
}
return 0
}
func (m *BgpPathBag_KEYS) GetRd() string {
if m != nil {
return m.Rd
}
return ""
}
func (m *BgpPathBag_KEYS) GetNetwork() string {
if m != nil {
return m.Network
}
return ""
}
func (m *BgpPathBag_KEYS) GetNeighborAddress() string {
if m != nil {
return m.NeighborAddress
}
return ""
}
func (m *BgpPathBag_KEYS) GetSourceRd() string {
if m != nil {
return m.SourceRd
}
return ""
}
func (m *BgpPathBag_KEYS) GetPathId() uint32 {
if m != nil {
return m.PathId
}
return 0
}
type BgpL2VpnAddrT struct {
L2VpnAddress []uint32 `protobuf:"varint,1,rep,packed,name=l2vpn_address,json=l2vpnAddress,proto3" json:"l2vpn_address,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpL2VpnAddrT) Reset() { *m = BgpL2VpnAddrT{} }
func (m *BgpL2VpnAddrT) String() string { return proto.CompactTextString(m) }
func (*BgpL2VpnAddrT) ProtoMessage() {}
func (*BgpL2VpnAddrT) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{1}
}
func (m *BgpL2VpnAddrT) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpL2VpnAddrT.Unmarshal(m, b)
}
func (m *BgpL2VpnAddrT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpL2VpnAddrT.Marshal(b, m, deterministic)
}
func (m *BgpL2VpnAddrT) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpL2VpnAddrT.Merge(m, src)
}
func (m *BgpL2VpnAddrT) XXX_Size() int {
return xxx_messageInfo_BgpL2VpnAddrT.Size(m)
}
func (m *BgpL2VpnAddrT) XXX_DiscardUnknown() {
xxx_messageInfo_BgpL2VpnAddrT.DiscardUnknown(m)
}
var xxx_messageInfo_BgpL2VpnAddrT proto.InternalMessageInfo
func (m *BgpL2VpnAddrT) GetL2VpnAddress() []uint32 {
if m != nil {
return m.L2VpnAddress
}
return nil
}
type BgpL2VpnMspwAddrT struct {
L2VpnAddress []uint32 `protobuf:"varint,1,rep,packed,name=l2vpn_address,json=l2vpnAddress,proto3" json:"l2vpn_address,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpL2VpnMspwAddrT) Reset() { *m = BgpL2VpnMspwAddrT{} }
func (m *BgpL2VpnMspwAddrT) String() string { return proto.CompactTextString(m) }
func (*BgpL2VpnMspwAddrT) ProtoMessage() {}
func (*BgpL2VpnMspwAddrT) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{2}
}
func (m *BgpL2VpnMspwAddrT) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpL2VpnMspwAddrT.Unmarshal(m, b)
}
func (m *BgpL2VpnMspwAddrT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpL2VpnMspwAddrT.Marshal(b, m, deterministic)
}
func (m *BgpL2VpnMspwAddrT) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpL2VpnMspwAddrT.Merge(m, src)
}
func (m *BgpL2VpnMspwAddrT) XXX_Size() int {
return xxx_messageInfo_BgpL2VpnMspwAddrT.Size(m)
}
func (m *BgpL2VpnMspwAddrT) XXX_DiscardUnknown() {
xxx_messageInfo_BgpL2VpnMspwAddrT.DiscardUnknown(m)
}
var xxx_messageInfo_BgpL2VpnMspwAddrT proto.InternalMessageInfo
func (m *BgpL2VpnMspwAddrT) GetL2VpnAddress() []uint32 {
if m != nil {
return m.L2VpnAddress
}
return nil
}
type BgpIpv4SrpolicyAddrT struct {
Ipv4SrpolicyAddress []uint32 `protobuf:"varint,1,rep,packed,name=ipv4_srpolicy_address,json=ipv4SrpolicyAddress,proto3" json:"ipv4_srpolicy_address,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpIpv4SrpolicyAddrT) Reset() { *m = BgpIpv4SrpolicyAddrT{} }
func (m *BgpIpv4SrpolicyAddrT) String() string { return proto.CompactTextString(m) }
func (*BgpIpv4SrpolicyAddrT) ProtoMessage() {}
func (*BgpIpv4SrpolicyAddrT) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{3}
}
func (m *BgpIpv4SrpolicyAddrT) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpIpv4SrpolicyAddrT.Unmarshal(m, b)
}
func (m *BgpIpv4SrpolicyAddrT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpIpv4SrpolicyAddrT.Marshal(b, m, deterministic)
}
func (m *BgpIpv4SrpolicyAddrT) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpIpv4SrpolicyAddrT.Merge(m, src)
}
func (m *BgpIpv4SrpolicyAddrT) XXX_Size() int {
return xxx_messageInfo_BgpIpv4SrpolicyAddrT.Size(m)
}
func (m *BgpIpv4SrpolicyAddrT) XXX_DiscardUnknown() {
xxx_messageInfo_BgpIpv4SrpolicyAddrT.DiscardUnknown(m)
}
var xxx_messageInfo_BgpIpv4SrpolicyAddrT proto.InternalMessageInfo
func (m *BgpIpv4SrpolicyAddrT) GetIpv4SrpolicyAddress() []uint32 {
if m != nil {
return m.Ipv4SrpolicyAddress
}
return nil
}
type BgpIpv6SrpolicyAddrT struct {
Ipv6SrpolicyAddress []uint32 `protobuf:"varint,1,rep,packed,name=ipv6_srpolicy_address,json=ipv6SrpolicyAddress,proto3" json:"ipv6_srpolicy_address,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpIpv6SrpolicyAddrT) Reset() { *m = BgpIpv6SrpolicyAddrT{} }
func (m *BgpIpv6SrpolicyAddrT) String() string { return proto.CompactTextString(m) }
func (*BgpIpv6SrpolicyAddrT) ProtoMessage() {}
func (*BgpIpv6SrpolicyAddrT) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{4}
}
func (m *BgpIpv6SrpolicyAddrT) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpIpv6SrpolicyAddrT.Unmarshal(m, b)
}
func (m *BgpIpv6SrpolicyAddrT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpIpv6SrpolicyAddrT.Marshal(b, m, deterministic)
}
func (m *BgpIpv6SrpolicyAddrT) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpIpv6SrpolicyAddrT.Merge(m, src)
}
func (m *BgpIpv6SrpolicyAddrT) XXX_Size() int {
return xxx_messageInfo_BgpIpv6SrpolicyAddrT.Size(m)
}
func (m *BgpIpv6SrpolicyAddrT) XXX_DiscardUnknown() {
xxx_messageInfo_BgpIpv6SrpolicyAddrT.DiscardUnknown(m)
}
var xxx_messageInfo_BgpIpv6SrpolicyAddrT proto.InternalMessageInfo
func (m *BgpIpv6SrpolicyAddrT) GetIpv6SrpolicyAddress() []uint32 {
if m != nil {
return m.Ipv6SrpolicyAddress
}
return nil
}
type BgpAddrtype struct {
Afi string `protobuf:"bytes,1,opt,name=afi,proto3" json:"afi,omitempty"`
Ipv4Address string `protobuf:"bytes,2,opt,name=ipv4_address,json=ipv4Address,proto3" json:"ipv4_address,omitempty"`
Ipv4McastAddress string `protobuf:"bytes,3,opt,name=ipv4_mcast_address,json=ipv4McastAddress,proto3" json:"ipv4_mcast_address,omitempty"`
Ipv4LabelAddress string `protobuf:"bytes,4,opt,name=ipv4_label_address,json=ipv4LabelAddress,proto3" json:"ipv4_label_address,omitempty"`
Ipv4TunnelAddress string `protobuf:"bytes,5,opt,name=ipv4_tunnel_address,json=ipv4TunnelAddress,proto3" json:"ipv4_tunnel_address,omitempty"`
Ipv4MdtAddress string `protobuf:"bytes,6,opt,name=ipv4mdt_address,json=ipv4mdtAddress,proto3" json:"ipv4mdt_address,omitempty"`
Ipv4VpnAddress string `protobuf:"bytes,7,opt,name=ipv4vpn_address,json=ipv4vpnAddress,proto3" json:"ipv4vpn_address,omitempty"`
Ipv4VpnaMcastddress string `protobuf:"bytes,8,opt,name=ipv4vpna_mcastddress,json=ipv4vpnaMcastddress,proto3" json:"ipv4vpna_mcastddress,omitempty"`
Ipv6Address string `protobuf:"bytes,9,opt,name=ipv6_address,json=ipv6Address,proto3" json:"ipv6_address,omitempty"`
Ipv6McastAddress string `protobuf:"bytes,10,opt,name=ipv6_mcast_address,json=ipv6McastAddress,proto3" json:"ipv6_mcast_address,omitempty"`
Ipv6LabelAddress string `protobuf:"bytes,11,opt,name=ipv6_label_address,json=ipv6LabelAddress,proto3" json:"ipv6_label_address,omitempty"`
Ipv6VpnAddress string `protobuf:"bytes,12,opt,name=ipv6vpn_address,json=ipv6vpnAddress,proto3" json:"ipv6vpn_address,omitempty"`
Ipv6VpnMcastAddress string `protobuf:"bytes,13,opt,name=ipv6vpn_mcast_address,json=ipv6vpnMcastAddress,proto3" json:"ipv6vpn_mcast_address,omitempty"`
L2VpnvplsAddress *BgpL2VpnAddrT `protobuf:"bytes,14,opt,name=l2vpnvpls_address,json=l2vpnvplsAddress,proto3" json:"l2vpnvpls_address,omitempty"`
RtConstraintAddress string `protobuf:"bytes,15,opt,name=rt_constraint_address,json=rtConstraintAddress,proto3" json:"rt_constraint_address,omitempty"`
Ipv6MvpnAddress string `protobuf:"bytes,16,opt,name=ipv6mvpn_address,json=ipv6mvpnAddress,proto3" json:"ipv6mvpn_address,omitempty"`
Ipv4MvpnAddress string `protobuf:"bytes,17,opt,name=ipv4mvpn_address,json=ipv4mvpnAddress,proto3" json:"ipv4mvpn_address,omitempty"`
L2VpnEvpnAddress string `protobuf:"bytes,18,opt,name=l2vpn_evpn_address,json=l2vpnEvpnAddress,proto3" json:"l2vpn_evpn_address,omitempty"`
LsLsAddress string `protobuf:"bytes,19,opt,name=ls_ls_address,json=lsLsAddress,proto3" json:"ls_ls_address,omitempty"`
L2VpnMspwAddress *BgpL2VpnMspwAddrT `protobuf:"bytes,20,opt,name=l2vpn_mspw_address,json=l2vpnMspwAddress,proto3" json:"l2vpn_mspw_address,omitempty"`
Ipv4FlowspecAddress string `protobuf:"bytes,21,opt,name=ipv4_flowspec_address,json=ipv4FlowspecAddress,proto3" json:"ipv4_flowspec_address,omitempty"`
Ipv6FlowspecAddress string `protobuf:"bytes,22,opt,name=ipv6_flowspec_address,json=ipv6FlowspecAddress,proto3" json:"ipv6_flowspec_address,omitempty"`
Ipv4VpnFlowspecAddress string `protobuf:"bytes,23,opt,name=ipv4vpn_flowspec_address,json=ipv4vpnFlowspecAddress,proto3" json:"ipv4vpn_flowspec_address,omitempty"`
Ipv6VpnFlowspecAddress string `protobuf:"bytes,24,opt,name=ipv6vpn_flowspec_address,json=ipv6vpnFlowspecAddress,proto3" json:"ipv6vpn_flowspec_address,omitempty"`
Ipv4SrPolicyAddress *BgpIpv4SrpolicyAddrT `protobuf:"bytes,25,opt,name=ipv4sr_policy_address,json=ipv4srPolicyAddress,proto3" json:"ipv4sr_policy_address,omitempty"`
Ipv6SrPolicyAddress *BgpIpv6SrpolicyAddrT `protobuf:"bytes,26,opt,name=ipv6sr_policy_address,json=ipv6srPolicyAddress,proto3" json:"ipv6sr_policy_address,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpAddrtype) Reset() { *m = BgpAddrtype{} }
func (m *BgpAddrtype) String() string { return proto.CompactTextString(m) }
func (*BgpAddrtype) ProtoMessage() {}
func (*BgpAddrtype) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{5}
}
func (m *BgpAddrtype) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpAddrtype.Unmarshal(m, b)
}
func (m *BgpAddrtype) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpAddrtype.Marshal(b, m, deterministic)
}
func (m *BgpAddrtype) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpAddrtype.Merge(m, src)
}
func (m *BgpAddrtype) XXX_Size() int {
return xxx_messageInfo_BgpAddrtype.Size(m)
}
func (m *BgpAddrtype) XXX_DiscardUnknown() {
xxx_messageInfo_BgpAddrtype.DiscardUnknown(m)
}
var xxx_messageInfo_BgpAddrtype proto.InternalMessageInfo
func (m *BgpAddrtype) GetAfi() string {
if m != nil {
return m.Afi
}
return ""
}
func (m *BgpAddrtype) GetIpv4Address() string {
if m != nil {
return m.Ipv4Address
}
return ""
}
func (m *BgpAddrtype) GetIpv4McastAddress() string {
if m != nil {
return m.Ipv4McastAddress
}
return ""
}
func (m *BgpAddrtype) GetIpv4LabelAddress() string {
if m != nil {
return m.Ipv4LabelAddress
}
return ""
}
func (m *BgpAddrtype) GetIpv4TunnelAddress() string {
if m != nil {
return m.Ipv4TunnelAddress
}
return ""
}
func (m *BgpAddrtype) GetIpv4MdtAddress() string {
if m != nil {
return m.Ipv4MdtAddress
}
return ""
}
func (m *BgpAddrtype) GetIpv4VpnAddress() string {
if m != nil {
return m.Ipv4VpnAddress
}
return ""
}
func (m *BgpAddrtype) GetIpv4VpnaMcastddress() string {
if m != nil {
return m.Ipv4VpnaMcastddress
}
return ""
}
func (m *BgpAddrtype) GetIpv6Address() string {
if m != nil {
return m.Ipv6Address
}
return ""
}
func (m *BgpAddrtype) GetIpv6McastAddress() string {
if m != nil {
return m.Ipv6McastAddress
}
return ""
}
func (m *BgpAddrtype) GetIpv6LabelAddress() string {
if m != nil {
return m.Ipv6LabelAddress
}
return ""
}
func (m *BgpAddrtype) GetIpv6VpnAddress() string {
if m != nil {
return m.Ipv6VpnAddress
}
return ""
}
func (m *BgpAddrtype) GetIpv6VpnMcastAddress() string {
if m != nil {
return m.Ipv6VpnMcastAddress
}
return ""
}
func (m *BgpAddrtype) GetL2VpnvplsAddress() *BgpL2VpnAddrT {
if m != nil {
return m.L2VpnvplsAddress
}
return nil
}
func (m *BgpAddrtype) GetRtConstraintAddress() string {
if m != nil {
return m.RtConstraintAddress
}
return ""
}
func (m *BgpAddrtype) GetIpv6MvpnAddress() string {
if m != nil {
return m.Ipv6MvpnAddress
}
return ""
}
func (m *BgpAddrtype) GetIpv4MvpnAddress() string {
if m != nil {
return m.Ipv4MvpnAddress
}
return ""
}
func (m *BgpAddrtype) GetL2VpnEvpnAddress() string {
if m != nil {
return m.L2VpnEvpnAddress
}
return ""
}
func (m *BgpAddrtype) GetLsLsAddress() string {
if m != nil {
return m.LsLsAddress
}
return ""
}
func (m *BgpAddrtype) GetL2VpnMspwAddress() *BgpL2VpnMspwAddrT {
if m != nil {
return m.L2VpnMspwAddress
}
return nil
}
func (m *BgpAddrtype) GetIpv4FlowspecAddress() string {
if m != nil {
return m.Ipv4FlowspecAddress
}
return ""
}
func (m *BgpAddrtype) GetIpv6FlowspecAddress() string {
if m != nil {
return m.Ipv6FlowspecAddress
}
return ""
}
func (m *BgpAddrtype) GetIpv4VpnFlowspecAddress() string {
if m != nil {
return m.Ipv4VpnFlowspecAddress
}
return ""
}
func (m *BgpAddrtype) GetIpv6VpnFlowspecAddress() string {
if m != nil {
return m.Ipv6VpnFlowspecAddress
}
return ""
}
func (m *BgpAddrtype) GetIpv4SrPolicyAddress() *BgpIpv4SrpolicyAddrT {
if m != nil {
return m.Ipv4SrPolicyAddress
}
return nil
}
func (m *BgpAddrtype) GetIpv6SrPolicyAddress() *BgpIpv6SrpolicyAddrT {
if m != nil {
return m.Ipv6SrPolicyAddress
}
return nil
}
type BgpPrefixtype struct {
Prefix *BgpAddrtype `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
PrefixLength uint32 `protobuf:"varint,2,opt,name=prefix_length,json=prefixLength,proto3" json:"prefix_length,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpPrefixtype) Reset() { *m = BgpPrefixtype{} }
func (m *BgpPrefixtype) String() string { return proto.CompactTextString(m) }
func (*BgpPrefixtype) ProtoMessage() {}
func (*BgpPrefixtype) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{6}
}
func (m *BgpPrefixtype) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpPrefixtype.Unmarshal(m, b)
}
func (m *BgpPrefixtype) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpPrefixtype.Marshal(b, m, deterministic)
}
func (m *BgpPrefixtype) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpPrefixtype.Merge(m, src)
}
func (m *BgpPrefixtype) XXX_Size() int {
return xxx_messageInfo_BgpPrefixtype.Size(m)
}
func (m *BgpPrefixtype) XXX_DiscardUnknown() {
xxx_messageInfo_BgpPrefixtype.DiscardUnknown(m)
}
var xxx_messageInfo_BgpPrefixtype proto.InternalMessageInfo
func (m *BgpPrefixtype) GetPrefix() *BgpAddrtype {
if m != nil {
return m.Prefix
}
return nil
}
func (m *BgpPrefixtype) GetPrefixLength() uint32 {
if m != nil {
return m.PrefixLength
}
return 0
}
type BgpTeTunnel struct {
TunnelType string `protobuf:"bytes,1,opt,name=tunnel_type,json=tunnelType,proto3" json:"tunnel_type,omitempty"`
TunnelName []uint32 `protobuf:"varint,2,rep,packed,name=tunnel_name,json=tunnelName,proto3" json:"tunnel_name,omitempty"`
HasTunnel bool `protobuf:"varint,3,opt,name=has_tunnel,json=hasTunnel,proto3" json:"has_tunnel,omitempty"`
IsTunnelUp bool `protobuf:"varint,4,opt,name=is_tunnel_up,json=isTunnelUp,proto3" json:"is_tunnel_up,omitempty"`
IsTunnelInfoStale bool `protobuf:"varint,5,opt,name=is_tunnel_info_stale,json=isTunnelInfoStale,proto3" json:"is_tunnel_info_stale,omitempty"`
IsTunnelRegistered bool `protobuf:"varint,6,opt,name=is_tunnel_registered,json=isTunnelRegistered,proto3" json:"is_tunnel_registered,omitempty"`
TunnelV6Required bool `protobuf:"varint,7,opt,name=tunnel_v6_required,json=tunnelV6Required,proto3" json:"tunnel_v6_required,omitempty"`
TunnelV6Enabled bool `protobuf:"varint,8,opt,name=tunnel_v6_enabled,json=tunnelV6Enabled,proto3" json:"tunnel_v6_enabled,omitempty"`
BindingLabel uint32 `protobuf:"varint,9,opt,name=binding_label,json=bindingLabel,proto3" json:"binding_label,omitempty"`
TunnelIfHandle uint32 `protobuf:"varint,10,opt,name=tunnel_if_handle,json=tunnelIfHandle,proto3" json:"tunnel_if_handle,omitempty"`
LastTunnelUpdate uint32 `protobuf:"varint,11,opt,name=last_tunnel_update,json=lastTunnelUpdate,proto3" json:"last_tunnel_update,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpTeTunnel) Reset() { *m = BgpTeTunnel{} }
func (m *BgpTeTunnel) String() string { return proto.CompactTextString(m) }
func (*BgpTeTunnel) ProtoMessage() {}
func (*BgpTeTunnel) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{7}
}
func (m *BgpTeTunnel) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpTeTunnel.Unmarshal(m, b)
}
func (m *BgpTeTunnel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpTeTunnel.Marshal(b, m, deterministic)
}
func (m *BgpTeTunnel) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpTeTunnel.Merge(m, src)
}
func (m *BgpTeTunnel) XXX_Size() int {
return xxx_messageInfo_BgpTeTunnel.Size(m)
}
func (m *BgpTeTunnel) XXX_DiscardUnknown() {
xxx_messageInfo_BgpTeTunnel.DiscardUnknown(m)
}
var xxx_messageInfo_BgpTeTunnel proto.InternalMessageInfo
func (m *BgpTeTunnel) GetTunnelType() string {
if m != nil {
return m.TunnelType
}
return ""
}
func (m *BgpTeTunnel) GetTunnelName() []uint32 {
if m != nil {
return m.TunnelName
}
return nil
}
func (m *BgpTeTunnel) GetHasTunnel() bool {
if m != nil {
return m.HasTunnel
}
return false
}
func (m *BgpTeTunnel) GetIsTunnelUp() bool {
if m != nil {
return m.IsTunnelUp
}
return false
}
func (m *BgpTeTunnel) GetIsTunnelInfoStale() bool {
if m != nil {
return m.IsTunnelInfoStale
}
return false
}
func (m *BgpTeTunnel) GetIsTunnelRegistered() bool {
if m != nil {
return m.IsTunnelRegistered
}
return false
}
func (m *BgpTeTunnel) GetTunnelV6Required() bool {
if m != nil {
return m.TunnelV6Required
}
return false
}
func (m *BgpTeTunnel) GetTunnelV6Enabled() bool {
if m != nil {
return m.TunnelV6Enabled
}
return false
}
func (m *BgpTeTunnel) GetBindingLabel() uint32 {
if m != nil {
return m.BindingLabel
}
return 0
}
func (m *BgpTeTunnel) GetTunnelIfHandle() uint32 {
if m != nil {
return m.TunnelIfHandle
}
return 0
}
func (m *BgpTeTunnel) GetLastTunnelUpdate() uint32 {
if m != nil {
return m.LastTunnelUpdate
}
return 0
}
type BgpL2VpnEvpnEsiT struct {
Esi []uint32 `protobuf:"varint,1,rep,packed,name=esi,proto3" json:"esi,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpL2VpnEvpnEsiT) Reset() { *m = BgpL2VpnEvpnEsiT{} }
func (m *BgpL2VpnEvpnEsiT) String() string { return proto.CompactTextString(m) }
func (*BgpL2VpnEvpnEsiT) ProtoMessage() {}
func (*BgpL2VpnEvpnEsiT) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{8}
}
func (m *BgpL2VpnEvpnEsiT) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpL2VpnEvpnEsiT.Unmarshal(m, b)
}
func (m *BgpL2VpnEvpnEsiT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpL2VpnEvpnEsiT.Marshal(b, m, deterministic)
}
func (m *BgpL2VpnEvpnEsiT) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpL2VpnEvpnEsiT.Merge(m, src)
}
func (m *BgpL2VpnEvpnEsiT) XXX_Size() int {
return xxx_messageInfo_BgpL2VpnEvpnEsiT.Size(m)
}
func (m *BgpL2VpnEvpnEsiT) XXX_DiscardUnknown() {
xxx_messageInfo_BgpL2VpnEvpnEsiT.DiscardUnknown(m)
}
var xxx_messageInfo_BgpL2VpnEvpnEsiT proto.InternalMessageInfo
func (m *BgpL2VpnEvpnEsiT) GetEsi() []uint32 {
if m != nil {
return m.Esi
}
return nil
}
type BgpV4V6T struct {
Len string `protobuf:"bytes,1,opt,name=len,proto3" json:"len,omitempty"`
Ipv4Address string `protobuf:"bytes,2,opt,name=ipv4_address,json=ipv4Address,proto3" json:"ipv4_address,omitempty"`
Ipv6Address string `protobuf:"bytes,3,opt,name=ipv6_address,json=ipv6Address,proto3" json:"ipv6_address,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpV4V6T) Reset() { *m = BgpV4V6T{} }
func (m *BgpV4V6T) String() string { return proto.CompactTextString(m) }
func (*BgpV4V6T) ProtoMessage() {}
func (*BgpV4V6T) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{9}
}
func (m *BgpV4V6T) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpV4V6T.Unmarshal(m, b)
}
func (m *BgpV4V6T) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpV4V6T.Marshal(b, m, deterministic)
}
func (m *BgpV4V6T) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpV4V6T.Merge(m, src)
}
func (m *BgpV4V6T) XXX_Size() int {
return xxx_messageInfo_BgpV4V6T.Size(m)
}
func (m *BgpV4V6T) XXX_DiscardUnknown() {
xxx_messageInfo_BgpV4V6T.DiscardUnknown(m)
}
var xxx_messageInfo_BgpV4V6T proto.InternalMessageInfo
func (m *BgpV4V6T) GetLen() string {
if m != nil {
return m.Len
}
return ""
}
func (m *BgpV4V6T) GetIpv4Address() string {
if m != nil {
return m.Ipv4Address
}
return ""
}
func (m *BgpV4V6T) GetIpv6Address() string {
if m != nil {
return m.Ipv6Address
}
return ""
}
type BgpAdvinfoType_ struct {
IsNeighbor bool `protobuf:"varint,1,opt,name=is_neighbor,json=isNeighbor,proto3" json:"is_neighbor,omitempty"`
NeighborAddressXr *BgpAddrtype `protobuf:"bytes,2,opt,name=neighbor_address_xr,json=neighborAddressXr,proto3" json:"neighbor_address_xr,omitempty"`
UpdateGroupNumber uint32 `protobuf:"varint,3,opt,name=update_group_number,json=updateGroupNumber,proto3" json:"update_group_number,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpAdvinfoType_) Reset() { *m = BgpAdvinfoType_{} }
func (m *BgpAdvinfoType_) String() string { return proto.CompactTextString(m) }
func (*BgpAdvinfoType_) ProtoMessage() {}
func (*BgpAdvinfoType_) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{10}
}
func (m *BgpAdvinfoType_) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpAdvinfoType_.Unmarshal(m, b)
}
func (m *BgpAdvinfoType_) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpAdvinfoType_.Marshal(b, m, deterministic)
}
func (m *BgpAdvinfoType_) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpAdvinfoType_.Merge(m, src)
}
func (m *BgpAdvinfoType_) XXX_Size() int {
return xxx_messageInfo_BgpAdvinfoType_.Size(m)
}
func (m *BgpAdvinfoType_) XXX_DiscardUnknown() {
xxx_messageInfo_BgpAdvinfoType_.DiscardUnknown(m)
}
var xxx_messageInfo_BgpAdvinfoType_ proto.InternalMessageInfo
func (m *BgpAdvinfoType_) GetIsNeighbor() bool {
if m != nil {
return m.IsNeighbor
}
return false
}
func (m *BgpAdvinfoType_) GetNeighborAddressXr() *BgpAddrtype {
if m != nil {
return m.NeighborAddressXr
}
return nil
}
func (m *BgpAdvinfoType_) GetUpdateGroupNumber() uint32 {
if m != nil {
return m.UpdateGroupNumber
}
return 0
}
type BgpPath_ struct {
BgpPrefix *BgpPrefixtype `protobuf:"bytes,1,opt,name=bgp_prefix,json=bgpPrefix,proto3" json:"bgp_prefix,omitempty"`
NeighborAddressXr *BgpAddrtype `protobuf:"bytes,2,opt,name=neighbor_address_xr,json=neighborAddressXr,proto3" json:"neighbor_address_xr,omitempty"`
RouteType string `protobuf:"bytes,3,opt,name=route_type,json=routeType,proto3" json:"route_type,omitempty"`
IsPathValid bool `protobuf:"varint,4,opt,name=is_path_valid,json=isPathValid,proto3" json:"is_path_valid,omitempty"`
IsPathDamped bool `protobuf:"varint,5,opt,name=is_path_damped,json=isPathDamped,proto3" json:"is_path_damped,omitempty"`
IsPathHistoryHeld bool `protobuf:"varint,6,opt,name=is_path_history_held,json=isPathHistoryHeld,proto3" json:"is_path_history_held,omitempty"`
IsInternalPath bool `protobuf:"varint,7,opt,name=is_internal_path,json=isInternalPath,proto3" json:"is_internal_path,omitempty"`
IsBestPath bool `protobuf:"varint,8,opt,name=is_best_path,json=isBestPath,proto3" json:"is_best_path,omitempty"`
IsAsBest bool `protobuf:"varint,9,opt,name=is_as_best,json=isAsBest,proto3" json:"is_as_best,omitempty"`
IsSpkrAsBest bool `protobuf:"varint,10,opt,name=is_spkr_as_best,json=isSpkrAsBest,proto3" json:"is_spkr_as_best,omitempty"`
IsPartialBest bool `protobuf:"varint,11,opt,name=is_partial_best,json=isPartialBest,proto3" json:"is_partial_best,omitempty"`
IsAggregationSuppressed bool `protobuf:"varint,12,opt,name=is_aggregation_suppressed,json=isAggregationSuppressed,proto3" json:"is_aggregation_suppressed,omitempty"`
IsImportDampened bool `protobuf:"varint,13,opt,name=is_import_dampened,json=isImportDampened,proto3" json:"is_import_dampened,omitempty"`
IsImportSuspect bool `protobuf:"varint,14,opt,name=is_import_suspect,json=isImportSuspect,proto3" json:"is_import_suspect,omitempty"`
IsPathNotAdvertised bool `protobuf:"varint,15,opt,name=is_path_not_advertised,json=isPathNotAdvertised,proto3" json:"is_path_not_advertised,omitempty"`
IsPathNotAdvertisedToEbgPs bool `protobuf:"varint,16,opt,name=is_path_not_advertised_to_ebg_ps,json=isPathNotAdvertisedToEbgPs,proto3" json:"is_path_not_advertised_to_ebg_ps,omitempty"`
IsPathAdvertisedLocalAsOnly bool `protobuf:"varint,17,opt,name=is_path_advertised_local_as_only,json=isPathAdvertisedLocalAsOnly,proto3" json:"is_path_advertised_local_as_only,omitempty"`
IsPathFromRouteReflector bool `protobuf:"varint,18,opt,name=is_path_from_route_reflector,json=isPathFromRouteReflector,proto3" json:"is_path_from_route_reflector,omitempty"`
IsPathReceivedOnly bool `protobuf:"varint,19,opt,name=is_path_received_only,json=isPathReceivedOnly,proto3" json:"is_path_received_only,omitempty"`
IsReceivedPathNotModified bool `protobuf:"varint,20,opt,name=is_received_path_not_modified,json=isReceivedPathNotModified,proto3" json:"is_received_path_not_modified,omitempty"`
IsPathLocallySourced bool `protobuf:"varint,21,opt,name=is_path_locally_sourced,json=isPathLocallySourced,proto3" json:"is_path_locally_sourced,omitempty"`
IsPathLocalAggregate bool `protobuf:"varint,22,opt,name=is_path_local_aggregate,json=isPathLocalAggregate,proto3" json:"is_path_local_aggregate,omitempty"`
IsPathFromNetworkCommand bool `protobuf:"varint,23,opt,name=is_path_from_network_command,json=isPathFromNetworkCommand,proto3" json:"is_path_from_network_command,omitempty"`
IsPathFromRedistributeCommand bool `protobuf:"varint,24,opt,name=is_path_from_redistribute_command,json=isPathFromRedistributeCommand,proto3" json:"is_path_from_redistribute_command,omitempty"`
IsPathImported bool `protobuf:"varint,25,opt,name=is_path_imported,json=isPathImported,proto3" json:"is_path_imported,omitempty"`
IsPathReoriginated bool `protobuf:"varint,26,opt,name=is_path_reoriginated,json=isPathReoriginated,proto3" json:"is_path_reoriginated,omitempty"`
IsPathReoriginatedStitching bool `protobuf:"varint,27,opt,name=is_path_reoriginated_stitching,json=isPathReoriginatedStitching,proto3" json:"is_path_reoriginated_stitching,omitempty"`
IsPathVpnOnly bool `protobuf:"varint,28,opt,name=is_path_vpn_only,json=isPathVpnOnly,proto3" json:"is_path_vpn_only,omitempty"`
IsPathFromConfederationPeer bool `protobuf:"varint,29,opt,name=is_path_from_confederation_peer,json=isPathFromConfederationPeer,proto3" json:"is_path_from_confederation_peer,omitempty"`
IsPathSyncedWithIgp bool `protobuf:"varint,30,opt,name=is_path_synced_with_igp,json=isPathSyncedWithIgp,proto3" json:"is_path_synced_with_igp,omitempty"`
IsPathMultipath bool `protobuf:"varint,31,opt,name=is_path_multipath,json=isPathMultipath,proto3" json:"is_path_multipath,omitempty"`
IsPathImpCandidate bool `protobuf:"varint,32,opt,name=is_path_imp_candidate,json=isPathImpCandidate,proto3" json:"is_path_imp_candidate,omitempty"`
IsPathStale bool `protobuf:"varint,33,opt,name=is_path_stale,json=isPathStale,proto3" json:"is_path_stale,omitempty"`
IsPathLongLivedStale bool `protobuf:"varint,34,opt,name=is_path_long_lived_stale,json=isPathLongLivedStale,proto3" json:"is_path_long_lived_stale,omitempty"`
IsPathBackup bool `protobuf:"varint,35,opt,name=is_path_backup,json=isPathBackup,proto3" json:"is_path_backup,omitempty"`
IsPathBackupProtectMultipath bool `protobuf:"varint,36,opt,name=is_path_backup_protect_multipath,json=isPathBackupProtectMultipath,proto3" json:"is_path_backup_protect_multipath,omitempty"`
IsPathBestExternal bool `protobuf:"varint,37,opt,name=is_path_best_external,json=isPathBestExternal,proto3" json:"is_path_best_external,omitempty"`
IsPathAdditionalPath bool `protobuf:"varint,38,opt,name=is_path_additional_path,json=isPathAdditionalPath,proto3" json:"is_path_additional_path,omitempty"`
IsPathNexthopDiscarded bool `protobuf:"varint,39,opt,name=is_path_nexthop_discarded,json=isPathNexthopDiscarded,proto3" json:"is_path_nexthop_discarded,omitempty"`
NextHop *BgpAddrtype `protobuf:"bytes,40,opt,name=next_hop,json=nextHop,proto3" json:"next_hop,omitempty"`
NhTunnel *BgpTeTunnel `protobuf:"bytes,41,opt,name=nh_tunnel,json=nhTunnel,proto3" json:"nh_tunnel,omitempty"`
HasRcvdLabel bool `protobuf:"varint,42,opt,name=has_rcvd_label,json=hasRcvdLabel,proto3" json:"has_rcvd_label,omitempty"`
RcvdLabel uint32 `protobuf:"varint,43,opt,name=rcvd_label,json=rcvdLabel,proto3" json:"rcvd_label,omitempty"`
HasLocalNetLabel bool `protobuf:"varint,44,opt,name=has_local_net_label,json=hasLocalNetLabel,proto3" json:"has_local_net_label,omitempty"`
LocalLabel uint32 `protobuf:"varint,45,opt,name=local_label,json=localLabel,proto3" json:"local_label,omitempty"`
IgpMetric uint32 `protobuf:"varint,46,opt,name=igp_metric,json=igpMetric,proto3" json:"igp_metric,omitempty"`
PathWeight uint32 `protobuf:"varint,47,opt,name=path_weight,json=pathWeight,proto3" json:"path_weight,omitempty"`
NeighborRouterId string `protobuf:"bytes,48,opt,name=neighbor_router_id,json=neighborRouterId,proto3" json:"neighbor_router_id,omitempty"`
HasMdtGroupAddr bool `protobuf:"varint,49,opt,name=has_mdt_group_addr,json=hasMdtGroupAddr,proto3" json:"has_mdt_group_addr,omitempty"`
MdtGroupAddr *BgpAddrtype `protobuf:"bytes,50,opt,name=mdt_group_addr,json=mdtGroupAddr,proto3" json:"mdt_group_addr,omitempty"`
L2VpnSize uint32 `protobuf:"varint,51,opt,name=l2vpn_size,json=l2vpnSize,proto3" json:"l2vpn_size,omitempty"`
HasEsi bool `protobuf:"varint,52,opt,name=has_esi,json=hasEsi,proto3" json:"has_esi,omitempty"`
L2VpnEvpnEsi *BgpL2VpnEvpnEsiT `protobuf:"bytes,53,opt,name=l2vpn_evpn_esi,json=l2vpnEvpnEsi,proto3" json:"l2vpn_evpn_esi,omitempty"`
HasGwAddr bool `protobuf:"varint,54,opt,name=has_gw_addr,json=hasGwAddr,proto3" json:"has_gw_addr,omitempty"`
GwAddr *BgpV4V6T `protobuf:"bytes,55,opt,name=gw_addr,json=gwAddr,proto3" json:"gw_addr,omitempty"`
HasNhAddr bool `protobuf:"varint,56,opt,name=has_nh_addr,json=hasNhAddr,proto3" json:"has_nh_addr,omitempty"`
NhAddr *BgpV4V6T `protobuf:"bytes,57,opt,name=nh_addr,json=nhAddr,proto3" json:"nh_addr,omitempty"`
HasSecondLabel bool `protobuf:"varint,58,opt,name=has_second_label,json=hasSecondLabel,proto3" json:"has_second_label,omitempty"`
SecondLabel uint32 `protobuf:"varint,59,opt,name=second_label,json=secondLabel,proto3" json:"second_label,omitempty"`
L2VpnCircuitStatusValue []uint32 `protobuf:"varint,60,rep,packed,name=l2vpn_circuit_status_value,json=l2vpnCircuitStatusValue,proto3" json:"l2vpn_circuit_status_value,omitempty"`
PathFlapCount uint32 `protobuf:"varint,61,opt,name=path_flap_count,json=pathFlapCount,proto3" json:"path_flap_count,omitempty"`
SecondsSinceFirstFlap uint32 `protobuf:"varint,62,opt,name=seconds_since_first_flap,json=secondsSinceFirstFlap,proto3" json:"seconds_since_first_flap,omitempty"`
TimeToUnsuppress uint32 `protobuf:"varint,63,opt,name=time_to_unsuppress,json=timeToUnsuppress,proto3" json:"time_to_unsuppress,omitempty"`
DampenPenalty uint32 `protobuf:"varint,64,opt,name=dampen_penalty,json=dampenPenalty,proto3" json:"dampen_penalty,omitempty"`
HalflifeTime uint32 `protobuf:"varint,65,opt,name=halflife_time,json=halflifeTime,proto3" json:"halflife_time,omitempty"`
SuppressPenalty uint32 `protobuf:"varint,66,opt,name=suppress_penalty,json=suppressPenalty,proto3" json:"suppress_penalty,omitempty"`
ReuseValue uint32 `protobuf:"varint,67,opt,name=reuse_value,json=reuseValue,proto3" json:"reuse_value,omitempty"`
MaximumSuppressTime uint32 `protobuf:"varint,68,opt,name=maximum_suppress_time,json=maximumSuppressTime,proto3" json:"maximum_suppress_time,omitempty"`
BestPathCompStage string `protobuf:"bytes,69,opt,name=best_path_comp_stage,json=bestPathCompStage,proto3" json:"best_path_comp_stage,omitempty"`
BestPathCompWinner *BgpAddrtype `protobuf:"bytes,70,opt,name=best_path_comp_winner,json=bestPathCompWinner,proto3" json:"best_path_comp_winner,omitempty"`
BestPathIdCompWinner uint32 `protobuf:"varint,71,opt,name=best_path_id_comp_winner,json=bestPathIdCompWinner,proto3" json:"best_path_id_comp_winner,omitempty"`
PathFlags uint64 `protobuf:"varint,72,opt,name=path_flags,json=pathFlags,proto3" json:"path_flags,omitempty"`
PathImportFlags uint32 `protobuf:"varint,73,opt,name=path_import_flags,json=pathImportFlags,proto3" json:"path_import_flags,omitempty"`
BestPathId uint32 `protobuf:"varint,74,opt,name=best_path_id,json=bestPathId,proto3" json:"best_path_id,omitempty"`
LocalPathId uint32 `protobuf:"varint,75,opt,name=local_path_id,json=localPathId,proto3" json:"local_path_id,omitempty"`
RcvdPathId uint32 `protobuf:"varint,76,opt,name=rcvd_path_id,json=rcvdPathId,proto3" json:"rcvd_path_id,omitempty"`
PathTableVersion uint32 `protobuf:"varint,77,opt,name=path_table_version,json=pathTableVersion,proto3" json:"path_table_version,omitempty"`
LocalPeersAdvertisedTo []*BgpAdvinfoType_ `protobuf:"bytes,78,rep,name=local_peers_advertised_to,json=localPeersAdvertisedTo,proto3" json:"local_peers_advertised_to,omitempty"`
PePeersAdvertisedTo []*BgpAdvinfoType_ `protobuf:"bytes,79,rep,name=pe_peers_advertised_to,json=pePeersAdvertisedTo,proto3" json:"pe_peers_advertised_to,omitempty"`
BestPathOrrBitfield []*BgpAdvinfoType_ `protobuf:"bytes,80,rep,name=best_path_orr_bitfield,json=bestPathOrrBitfield,proto3" json:"best_path_orr_bitfield,omitempty"`
AddPathOrrBitfield []*BgpAdvinfoType_ `protobuf:"bytes,81,rep,name=add_path_orr_bitfield,json=addPathOrrBitfield,proto3" json:"add_path_orr_bitfield,omitempty"`
AdvertisedtoPe bool `protobuf:"varint,82,opt,name=advertisedto_pe,json=advertisedtoPe,proto3" json:"advertisedto_pe,omitempty"`
RibFailed bool `protobuf:"varint,83,opt,name=rib_failed,json=ribFailed,proto3" json:"rib_failed,omitempty"`
SnRpkiOriginAsValidity uint32 `protobuf:"varint,84,opt,name=sn_rpki_origin_as_validity,json=snRpkiOriginAsValidity,proto3" json:"sn_rpki_origin_as_validity,omitempty"`
ShowRpkiOriginAsValidity bool `protobuf:"varint,85,opt,name=show_rpki_origin_as_validity,json=showRpkiOriginAsValidity,proto3" json:"show_rpki_origin_as_validity,omitempty"`
IbgpSignaledValidity bool `protobuf:"varint,86,opt,name=ibgp_signaled_validity,json=ibgpSignaledValidity,proto3" json:"ibgp_signaled_validity,omitempty"`
RpkiOriginAsValidationDisabled bool `protobuf:"varint,87,opt,name=rpki_origin_as_validation_disabled,json=rpkiOriginAsValidationDisabled,proto3" json:"rpki_origin_as_validation_disabled,omitempty"`
AcceptOwnPath bool `protobuf:"varint,88,opt,name=accept_own_path,json=acceptOwnPath,proto3" json:"accept_own_path,omitempty"`
AcceptOwnSelfOriginatedPAth bool `protobuf:"varint,89,opt,name=accept_own_self_originated_p_ath,json=acceptOwnSelfOriginatedPAth,proto3" json:"accept_own_self_originated_p_ath,omitempty"`
AigpMetric uint64 `protobuf:"varint,90,opt,name=aigp_metric,json=aigpMetric,proto3" json:"aigp_metric,omitempty"`
MvpnSfsPath bool `protobuf:"varint,91,opt,name=mvpn_sfs_path,json=mvpnSfsPath,proto3" json:"mvpn_sfs_path,omitempty"`
FspecInvalidPath bool `protobuf:"varint,92,opt,name=fspec_invalid_path,json=fspecInvalidPath,proto3" json:"fspec_invalid_path,omitempty"`
HasMvpnNbrAddr bool `protobuf:"varint,93,opt,name=has_mvpn_nbr_addr,json=hasMvpnNbrAddr,proto3" json:"has_mvpn_nbr_addr,omitempty"`
MvpnNbrAddr *BgpAddrtype `protobuf:"bytes,94,opt,name=mvpn_nbr_addr,json=mvpnNbrAddr,proto3" json:"mvpn_nbr_addr,omitempty"`
HasMvpnNexthopAddr bool `protobuf:"varint,95,opt,name=has_mvpn_nexthop_addr,json=hasMvpnNexthopAddr,proto3" json:"has_mvpn_nexthop_addr,omitempty"`
MvpnNexthopAddr *BgpAddrtype `protobuf:"bytes,96,opt,name=mvpn_nexthop_addr,json=mvpnNexthopAddr,proto3" json:"mvpn_nexthop_addr,omitempty"`
HasMvpnPmsi bool `protobuf:"varint,97,opt,name=has_mvpn_pmsi,json=hasMvpnPmsi,proto3" json:"has_mvpn_pmsi,omitempty"`
MvpnPmsiType uint32 `protobuf:"varint,98,opt,name=mvpn_pmsi_type,json=mvpnPmsiType,proto3" json:"mvpn_pmsi_type,omitempty"`
MvpnPmsiFlags uint32 `protobuf:"varint,99,opt,name=mvpn_pmsi_flags,json=mvpnPmsiFlags,proto3" json:"mvpn_pmsi_flags,omitempty"`
MvpnPmsiLabel uint32 `protobuf:"varint,100,opt,name=mvpn_pmsi_label,json=mvpnPmsiLabel,proto3" json:"mvpn_pmsi_label,omitempty"`
MvpnPmsiValue []uint32 `protobuf:"varint,101,rep,packed,name=mvpn_pmsi_value,json=mvpnPmsiValue,proto3" json:"mvpn_pmsi_value,omitempty"`
HasMvpnExtcomm bool `protobuf:"varint,102,opt,name=has_mvpn_extcomm,json=hasMvpnExtcomm,proto3" json:"has_mvpn_extcomm,omitempty"`
ExtendedCommunity []uint32 `protobuf:"varint,103,rep,packed,name=extended_community,json=extendedCommunity,proto3" json:"extended_community,omitempty"`
MvpnPathFlags uint32 `protobuf:"varint,104,opt,name=mvpn_path_flags,json=mvpnPathFlags,proto3" json:"mvpn_path_flags,omitempty"`
LocalNh bool `protobuf:"varint,105,opt,name=local_nh,json=localNh,proto3" json:"local_nh,omitempty"`
RtSetLimitEnabled bool `protobuf:"varint,106,opt,name=rt_set_limit_enabled,json=rtSetLimitEnabled,proto3" json:"rt_set_limit_enabled,omitempty"`
PathRtSetId uint32 `protobuf:"varint,107,opt,name=path_rt_set_id,json=pathRtSetId,proto3" json:"path_rt_set_id,omitempty"`
PathRtSetRouteCount uint32 `protobuf:"varint,108,opt,name=path_rt_set_route_count,json=pathRtSetRouteCount,proto3" json:"path_rt_set_route_count,omitempty"`
IsPathAfInstallEligible bool `protobuf:"varint,109,opt,name=is_path_af_install_eligible,json=isPathAfInstallEligible,proto3" json:"is_path_af_install_eligible,omitempty"`
IsPermanentPath bool `protobuf:"varint,110,opt,name=is_permanent_path,json=isPermanentPath,proto3" json:"is_permanent_path,omitempty"`
GracefulShutdown bool `protobuf:"varint,111,opt,name=graceful_shutdown,json=gracefulShutdown,proto3" json:"graceful_shutdown,omitempty"`
LabeledUnicastSafiPath bool `protobuf:"varint,112,opt,name=labeled_unicast_safi_path,json=labeledUnicastSafiPath,proto3" json:"labeled_unicast_safi_path,omitempty"`
VpnPathFlags uint32 `protobuf:"varint,113,opt,name=vpn_path_flags,json=vpnPathFlags,proto3" json:"vpn_path_flags,omitempty"`
HasVpnNexthopAddr bool `protobuf:"varint,114,opt,name=has_vpn_nexthop_addr,json=hasVpnNexthopAddr,proto3" json:"has_vpn_nexthop_addr,omitempty"`
VpnNexthopAddr *BgpAddrtype `protobuf:"bytes,115,opt,name=vpn_nexthop_addr,json=vpnNexthopAddr,proto3" json:"vpn_nexthop_addr,omitempty"`
IsOrigSrcRdPresent bool `protobuf:"varint,116,opt,name=is_orig_src_rd_present,json=isOrigSrcRdPresent,proto3" json:"is_orig_src_rd_present,omitempty"`
AfName string `protobuf:"bytes,117,opt,name=af_name,json=afName,proto3" json:"af_name,omitempty"`
RouteDistinguisher string `protobuf:"bytes,118,opt,name=route_distinguisher,json=routeDistinguisher,proto3" json:"route_distinguisher,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpPath_) Reset() { *m = BgpPath_{} }
func (m *BgpPath_) String() string { return proto.CompactTextString(m) }
func (*BgpPath_) ProtoMessage() {}
func (*BgpPath_) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{11}
}
func (m *BgpPath_) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpPath_.Unmarshal(m, b)
}
func (m *BgpPath_) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpPath_.Marshal(b, m, deterministic)
}
func (m *BgpPath_) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpPath_.Merge(m, src)
}
func (m *BgpPath_) XXX_Size() int {
return xxx_messageInfo_BgpPath_.Size(m)
}
func (m *BgpPath_) XXX_DiscardUnknown() {
xxx_messageInfo_BgpPath_.DiscardUnknown(m)
}
var xxx_messageInfo_BgpPath_ proto.InternalMessageInfo
func (m *BgpPath_) GetBgpPrefix() *BgpPrefixtype {
if m != nil {
return m.BgpPrefix
}
return nil
}
func (m *BgpPath_) GetNeighborAddressXr() *BgpAddrtype {
if m != nil {
return m.NeighborAddressXr
}
return nil
}
func (m *BgpPath_) GetRouteType() string {
if m != nil {
return m.RouteType
}
return ""
}
func (m *BgpPath_) GetIsPathValid() bool {
if m != nil {
return m.IsPathValid
}
return false
}
func (m *BgpPath_) GetIsPathDamped() bool {
if m != nil {
return m.IsPathDamped
}
return false
}
func (m *BgpPath_) GetIsPathHistoryHeld() bool {
if m != nil {
return m.IsPathHistoryHeld
}
return false
}
func (m *BgpPath_) GetIsInternalPath() bool {
if m != nil {
return m.IsInternalPath
}
return false
}
func (m *BgpPath_) GetIsBestPath() bool {
if m != nil {
return m.IsBestPath
}
return false
}
func (m *BgpPath_) GetIsAsBest() bool {
if m != nil {
return m.IsAsBest
}
return false
}
func (m *BgpPath_) GetIsSpkrAsBest() bool {
if m != nil {
return m.IsSpkrAsBest
}
return false
}
func (m *BgpPath_) GetIsPartialBest() bool {
if m != nil {
return m.IsPartialBest
}
return false
}
func (m *BgpPath_) GetIsAggregationSuppressed() bool {
if m != nil {
return m.IsAggregationSuppressed
}
return false
}
func (m *BgpPath_) GetIsImportDampened() bool {
if m != nil {
return m.IsImportDampened
}
return false
}
func (m *BgpPath_) GetIsImportSuspect() bool {
if m != nil {
return m.IsImportSuspect
}
return false
}
func (m *BgpPath_) GetIsPathNotAdvertised() bool {
if m != nil {
return m.IsPathNotAdvertised
}
return false
}
func (m *BgpPath_) GetIsPathNotAdvertisedToEbgPs() bool {
if m != nil {
return m.IsPathNotAdvertisedToEbgPs
}
return false
}
func (m *BgpPath_) GetIsPathAdvertisedLocalAsOnly() bool {
if m != nil {
return m.IsPathAdvertisedLocalAsOnly
}
return false
}
func (m *BgpPath_) GetIsPathFromRouteReflector() bool {
if m != nil {
return m.IsPathFromRouteReflector
}
return false
}
func (m *BgpPath_) GetIsPathReceivedOnly() bool {
if m != nil {
return m.IsPathReceivedOnly
}
return false
}
func (m *BgpPath_) GetIsReceivedPathNotModified() bool {
if m != nil {
return m.IsReceivedPathNotModified
}
return false
}
func (m *BgpPath_) GetIsPathLocallySourced() bool {
if m != nil {
return m.IsPathLocallySourced
}
return false
}
func (m *BgpPath_) GetIsPathLocalAggregate() bool {
if m != nil {
return m.IsPathLocalAggregate
}
return false
}
func (m *BgpPath_) GetIsPathFromNetworkCommand() bool {
if m != nil {
return m.IsPathFromNetworkCommand
}
return false
}
func (m *BgpPath_) GetIsPathFromRedistributeCommand() bool {
if m != nil {
return m.IsPathFromRedistributeCommand
}
return false
}
func (m *BgpPath_) GetIsPathImported() bool {
if m != nil {
return m.IsPathImported
}
return false
}
func (m *BgpPath_) GetIsPathReoriginated() bool {
if m != nil {
return m.IsPathReoriginated
}
return false
}
func (m *BgpPath_) GetIsPathReoriginatedStitching() bool {
if m != nil {
return m.IsPathReoriginatedStitching
}
return false
}
func (m *BgpPath_) GetIsPathVpnOnly() bool {
if m != nil {
return m.IsPathVpnOnly
}
return false
}
func (m *BgpPath_) GetIsPathFromConfederationPeer() bool {
if m != nil {
return m.IsPathFromConfederationPeer
}
return false
}
func (m *BgpPath_) GetIsPathSyncedWithIgp() bool {
if m != nil {
return m.IsPathSyncedWithIgp
}
return false
}
func (m *BgpPath_) GetIsPathMultipath() bool {
if m != nil {
return m.IsPathMultipath
}
return false
}
func (m *BgpPath_) GetIsPathImpCandidate() bool {
if m != nil {
return m.IsPathImpCandidate
}
return false
}
func (m *BgpPath_) GetIsPathStale() bool {
if m != nil {
return m.IsPathStale
}
return false
}
func (m *BgpPath_) GetIsPathLongLivedStale() bool {
if m != nil {
return m.IsPathLongLivedStale
}
return false
}
func (m *BgpPath_) GetIsPathBackup() bool {
if m != nil {
return m.IsPathBackup
}
return false
}
func (m *BgpPath_) GetIsPathBackupProtectMultipath() bool {
if m != nil {
return m.IsPathBackupProtectMultipath
}
return false
}
func (m *BgpPath_) GetIsPathBestExternal() bool {
if m != nil {
return m.IsPathBestExternal
}
return false
}
func (m *BgpPath_) GetIsPathAdditionalPath() bool {
if m != nil {
return m.IsPathAdditionalPath
}
return false
}
func (m *BgpPath_) GetIsPathNexthopDiscarded() bool {
if m != nil {
return m.IsPathNexthopDiscarded
}
return false
}
func (m *BgpPath_) GetNextHop() *BgpAddrtype {
if m != nil {
return m.NextHop
}
return nil
}
func (m *BgpPath_) GetNhTunnel() *BgpTeTunnel {
if m != nil {
return m.NhTunnel
}
return nil
}
func (m *BgpPath_) GetHasRcvdLabel() bool {
if m != nil {
return m.HasRcvdLabel
}
return false
}
func (m *BgpPath_) GetRcvdLabel() uint32 {
if m != nil {
return m.RcvdLabel
}
return 0
}
func (m *BgpPath_) GetHasLocalNetLabel() bool {
if m != nil {
return m.HasLocalNetLabel
}
return false
}
func (m *BgpPath_) GetLocalLabel() uint32 {
if m != nil {
return m.LocalLabel
}
return 0
}
func (m *BgpPath_) GetIgpMetric() uint32 {
if m != nil {
return m.IgpMetric
}
return 0
}
func (m *BgpPath_) GetPathWeight() uint32 {
if m != nil {
return m.PathWeight
}
return 0
}
func (m *BgpPath_) GetNeighborRouterId() string {
if m != nil {
return m.NeighborRouterId
}
return ""
}
func (m *BgpPath_) GetHasMdtGroupAddr() bool {
if m != nil {
return m.HasMdtGroupAddr
}
return false
}
func (m *BgpPath_) GetMdtGroupAddr() *BgpAddrtype {
if m != nil {
return m.MdtGroupAddr
}
return nil
}
func (m *BgpPath_) GetL2VpnSize() uint32 {
if m != nil {
return m.L2VpnSize
}
return 0
}
func (m *BgpPath_) GetHasEsi() bool {
if m != nil {
return m.HasEsi
}
return false
}
func (m *BgpPath_) GetL2VpnEvpnEsi() *BgpL2VpnEvpnEsiT {
if m != nil {
return m.L2VpnEvpnEsi
}
return nil
}
func (m *BgpPath_) GetHasGwAddr() bool {
if m != nil {
return m.HasGwAddr
}
return false
}
func (m *BgpPath_) GetGwAddr() *BgpV4V6T {
if m != nil {
return m.GwAddr
}
return nil
}
func (m *BgpPath_) GetHasNhAddr() bool {
if m != nil {
return m.HasNhAddr
}
return false
}
func (m *BgpPath_) GetNhAddr() *BgpV4V6T {
if m != nil {
return m.NhAddr
}
return nil
}
func (m *BgpPath_) GetHasSecondLabel() bool {
if m != nil {
return m.HasSecondLabel
}
return false
}
func (m *BgpPath_) GetSecondLabel() uint32 {
if m != nil {
return m.SecondLabel
}
return 0
}
func (m *BgpPath_) GetL2VpnCircuitStatusValue() []uint32 {
if m != nil {
return m.L2VpnCircuitStatusValue
}
return nil
}
func (m *BgpPath_) GetPathFlapCount() uint32 {
if m != nil {
return m.PathFlapCount
}
return 0
}
func (m *BgpPath_) GetSecondsSinceFirstFlap() uint32 {
if m != nil {
return m.SecondsSinceFirstFlap
}
return 0
}
func (m *BgpPath_) GetTimeToUnsuppress() uint32 {
if m != nil {
return m.TimeToUnsuppress
}
return 0
}
func (m *BgpPath_) GetDampenPenalty() uint32 {
if m != nil {
return m.DampenPenalty
}
return 0
}
func (m *BgpPath_) GetHalflifeTime() uint32 {
if m != nil {
return m.HalflifeTime
}
return 0
}
func (m *BgpPath_) GetSuppressPenalty() uint32 {
if m != nil {
return m.SuppressPenalty
}
return 0
}
func (m *BgpPath_) GetReuseValue() uint32 {
if m != nil {
return m.ReuseValue
}
return 0
}
func (m *BgpPath_) GetMaximumSuppressTime() uint32 {
if m != nil {
return m.MaximumSuppressTime
}
return 0
}
func (m *BgpPath_) GetBestPathCompStage() string {
if m != nil {
return m.BestPathCompStage
}
return ""
}
func (m *BgpPath_) GetBestPathCompWinner() *BgpAddrtype {
if m != nil {
return m.BestPathCompWinner
}
return nil
}
func (m *BgpPath_) GetBestPathIdCompWinner() uint32 {
if m != nil {
return m.BestPathIdCompWinner
}
return 0
}
func (m *BgpPath_) GetPathFlags() uint64 {
if m != nil {
return m.PathFlags
}
return 0
}
func (m *BgpPath_) GetPathImportFlags() uint32 {
if m != nil {
return m.PathImportFlags
}
return 0
}
func (m *BgpPath_) GetBestPathId() uint32 {
if m != nil {
return m.BestPathId
}
return 0
}
func (m *BgpPath_) GetLocalPathId() uint32 {
if m != nil {
return m.LocalPathId
}
return 0
}
func (m *BgpPath_) GetRcvdPathId() uint32 {
if m != nil {
return m.RcvdPathId
}
return 0
}
func (m *BgpPath_) GetPathTableVersion() uint32 {
if m != nil {
return m.PathTableVersion
}
return 0
}
func (m *BgpPath_) GetLocalPeersAdvertisedTo() []*BgpAdvinfoType_ {
if m != nil {
return m.LocalPeersAdvertisedTo
}
return nil
}
func (m *BgpPath_) GetPePeersAdvertisedTo() []*BgpAdvinfoType_ {
if m != nil {
return m.PePeersAdvertisedTo
}
return nil
}
func (m *BgpPath_) GetBestPathOrrBitfield() []*BgpAdvinfoType_ {
if m != nil {
return m.BestPathOrrBitfield
}
return nil
}
func (m *BgpPath_) GetAddPathOrrBitfield() []*BgpAdvinfoType_ {
if m != nil {
return m.AddPathOrrBitfield
}
return nil
}
func (m *BgpPath_) GetAdvertisedtoPe() bool {
if m != nil {
return m.AdvertisedtoPe
}
return false
}
func (m *BgpPath_) GetRibFailed() bool {
if m != nil {
return m.RibFailed
}
return false
}
func (m *BgpPath_) GetSnRpkiOriginAsValidity() uint32 {
if m != nil {
return m.SnRpkiOriginAsValidity
}
return 0
}
func (m *BgpPath_) GetShowRpkiOriginAsValidity() bool {
if m != nil {
return m.ShowRpkiOriginAsValidity
}
return false
}
func (m *BgpPath_) GetIbgpSignaledValidity() bool {
if m != nil {
return m.IbgpSignaledValidity
}
return false
}
func (m *BgpPath_) GetRpkiOriginAsValidationDisabled() bool {
if m != nil {
return m.RpkiOriginAsValidationDisabled
}
return false
}
func (m *BgpPath_) GetAcceptOwnPath() bool {
if m != nil {
return m.AcceptOwnPath
}
return false
}
func (m *BgpPath_) GetAcceptOwnSelfOriginatedPAth() bool {
if m != nil {
return m.AcceptOwnSelfOriginatedPAth
}
return false
}
func (m *BgpPath_) GetAigpMetric() uint64 {
if m != nil {
return m.AigpMetric
}
return 0
}
func (m *BgpPath_) GetMvpnSfsPath() bool {
if m != nil {
return m.MvpnSfsPath
}
return false
}
func (m *BgpPath_) GetFspecInvalidPath() bool {
if m != nil {
return m.FspecInvalidPath
}
return false
}
func (m *BgpPath_) GetHasMvpnNbrAddr() bool {
if m != nil {
return m.HasMvpnNbrAddr
}
return false
}
func (m *BgpPath_) GetMvpnNbrAddr() *BgpAddrtype {
if m != nil {
return m.MvpnNbrAddr
}
return nil
}
func (m *BgpPath_) GetHasMvpnNexthopAddr() bool {
if m != nil {
return m.HasMvpnNexthopAddr
}
return false
}
func (m *BgpPath_) GetMvpnNexthopAddr() *BgpAddrtype {
if m != nil {
return m.MvpnNexthopAddr
}
return nil
}
func (m *BgpPath_) GetHasMvpnPmsi() bool {
if m != nil {
return m.HasMvpnPmsi
}
return false
}
func (m *BgpPath_) GetMvpnPmsiType() uint32 {
if m != nil {
return m.MvpnPmsiType
}
return 0
}
func (m *BgpPath_) GetMvpnPmsiFlags() uint32 {
if m != nil {
return m.MvpnPmsiFlags
}
return 0
}
func (m *BgpPath_) GetMvpnPmsiLabel() uint32 {
if m != nil {
return m.MvpnPmsiLabel
}
return 0
}
func (m *BgpPath_) GetMvpnPmsiValue() []uint32 {
if m != nil {
return m.MvpnPmsiValue
}
return nil
}
func (m *BgpPath_) GetHasMvpnExtcomm() bool {
if m != nil {
return m.HasMvpnExtcomm
}
return false
}
func (m *BgpPath_) GetExtendedCommunity() []uint32 {
if m != nil {
return m.ExtendedCommunity
}
return nil
}
func (m *BgpPath_) GetMvpnPathFlags() uint32 {
if m != nil {
return m.MvpnPathFlags
}
return 0
}
func (m *BgpPath_) GetLocalNh() bool {
if m != nil {
return m.LocalNh
}
return false
}
func (m *BgpPath_) GetRtSetLimitEnabled() bool {
if m != nil {
return m.RtSetLimitEnabled
}
return false
}
func (m *BgpPath_) GetPathRtSetId() uint32 {
if m != nil {
return m.PathRtSetId
}
return 0
}
func (m *BgpPath_) GetPathRtSetRouteCount() uint32 {
if m != nil {
return m.PathRtSetRouteCount
}
return 0
}
func (m *BgpPath_) GetIsPathAfInstallEligible() bool {
if m != nil {
return m.IsPathAfInstallEligible
}
return false
}
func (m *BgpPath_) GetIsPermanentPath() bool {
if m != nil {
return m.IsPermanentPath
}
return false
}
func (m *BgpPath_) GetGracefulShutdown() bool {
if m != nil {
return m.GracefulShutdown
}
return false
}
func (m *BgpPath_) GetLabeledUnicastSafiPath() bool {
if m != nil {
return m.LabeledUnicastSafiPath
}
return false
}
func (m *BgpPath_) GetVpnPathFlags() uint32 {
if m != nil {
return m.VpnPathFlags
}
return 0
}
func (m *BgpPath_) GetHasVpnNexthopAddr() bool {
if m != nil {
return m.HasVpnNexthopAddr
}
return false
}
func (m *BgpPath_) GetVpnNexthopAddr() *BgpAddrtype {
if m != nil {
return m.VpnNexthopAddr
}
return nil
}
func (m *BgpPath_) GetIsOrigSrcRdPresent() bool {
if m != nil {
return m.IsOrigSrcRdPresent
}
return false
}
func (m *BgpPath_) GetAfName() string {
if m != nil {
return m.AfName
}
return ""
}
func (m *BgpPath_) GetRouteDistinguisher() string {
if m != nil {
return m.RouteDistinguisher
}
return ""
}
type BgpPedistlblEntry_ struct {
PeAddress string `protobuf:"bytes,1,opt,name=pe_address,json=peAddress,proto3" json:"pe_address,omitempty"`
Label uint32 `protobuf:"varint,2,opt,name=label,proto3" json:"label,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpPedistlblEntry_) Reset() { *m = BgpPedistlblEntry_{} }
func (m *BgpPedistlblEntry_) String() string { return proto.CompactTextString(m) }
func (*BgpPedistlblEntry_) ProtoMessage() {}
func (*BgpPedistlblEntry_) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{12}
}
func (m *BgpPedistlblEntry_) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpPedistlblEntry_.Unmarshal(m, b)
}
func (m *BgpPedistlblEntry_) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpPedistlblEntry_.Marshal(b, m, deterministic)
}
func (m *BgpPedistlblEntry_) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpPedistlblEntry_.Merge(m, src)
}
func (m *BgpPedistlblEntry_) XXX_Size() int {
return xxx_messageInfo_BgpPedistlblEntry_.Size(m)
}
func (m *BgpPedistlblEntry_) XXX_DiscardUnknown() {
xxx_messageInfo_BgpPedistlblEntry_.DiscardUnknown(m)
}
var xxx_messageInfo_BgpPedistlblEntry_ proto.InternalMessageInfo
func (m *BgpPedistlblEntry_) GetPeAddress() string {
if m != nil {
return m.PeAddress
}
return ""
}
func (m *BgpPedistlblEntry_) GetLabel() uint32 {
if m != nil {
return m.Label
}
return 0
}
type BgpBindingSidT struct {
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
Label uint32 `protobuf:"varint,2,opt,name=label,proto3" json:"label,omitempty"`
Ipv6Address string `protobuf:"bytes,3,opt,name=ipv6_address,json=ipv6Address,proto3" json:"ipv6_address,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpBindingSidT) Reset() { *m = BgpBindingSidT{} }
func (m *BgpBindingSidT) String() string { return proto.CompactTextString(m) }
func (*BgpBindingSidT) ProtoMessage() {}
func (*BgpBindingSidT) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{13}
}
func (m *BgpBindingSidT) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpBindingSidT.Unmarshal(m, b)
}
func (m *BgpBindingSidT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpBindingSidT.Marshal(b, m, deterministic)
}
func (m *BgpBindingSidT) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpBindingSidT.Merge(m, src)
}
func (m *BgpBindingSidT) XXX_Size() int {
return xxx_messageInfo_BgpBindingSidT.Size(m)
}
func (m *BgpBindingSidT) XXX_DiscardUnknown() {
xxx_messageInfo_BgpBindingSidT.DiscardUnknown(m)
}
var xxx_messageInfo_BgpBindingSidT proto.InternalMessageInfo
func (m *BgpBindingSidT) GetType() string {
if m != nil {
return m.Type
}
return ""
}
func (m *BgpBindingSidT) GetLabel() uint32 {
if m != nil {
return m.Label
}
return 0
}
func (m *BgpBindingSidT) GetIpv6Address() string {
if m != nil {
return m.Ipv6Address
}
return ""
}
type SrSid_ struct {
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
Label uint32 `protobuf:"varint,2,opt,name=label,proto3" json:"label,omitempty"`
Ipv4Address string `protobuf:"bytes,3,opt,name=ipv4_address,json=ipv4Address,proto3" json:"ipv4_address,omitempty"`
Ipv6Address string `protobuf:"bytes,4,opt,name=ipv6_address,json=ipv6Address,proto3" json:"ipv6_address,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SrSid_) Reset() { *m = SrSid_{} }
func (m *SrSid_) String() string { return proto.CompactTextString(m) }
func (*SrSid_) ProtoMessage() {}
func (*SrSid_) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{14}
}
func (m *SrSid_) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SrSid_.Unmarshal(m, b)
}
func (m *SrSid_) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SrSid_.Marshal(b, m, deterministic)
}
func (m *SrSid_) XXX_Merge(src proto.Message) {
xxx_messageInfo_SrSid_.Merge(m, src)
}
func (m *SrSid_) XXX_Size() int {
return xxx_messageInfo_SrSid_.Size(m)
}
func (m *SrSid_) XXX_DiscardUnknown() {
xxx_messageInfo_SrSid_.DiscardUnknown(m)
}
var xxx_messageInfo_SrSid_ proto.InternalMessageInfo
func (m *SrSid_) GetType() string {
if m != nil {
return m.Type
}
return ""
}
func (m *SrSid_) GetLabel() uint32 {
if m != nil {
return m.Label
}
return 0
}
func (m *SrSid_) GetIpv4Address() string {
if m != nil {
return m.Ipv4Address
}
return ""
}
func (m *SrSid_) GetIpv6Address() string {
if m != nil {
return m.Ipv6Address
}
return ""
}
type SrExppath_ struct {
Weight uint32 `protobuf:"varint,1,opt,name=weight,proto3" json:"weight,omitempty"`
Segment []*SrSid_ `protobuf:"bytes,2,rep,name=segment,proto3" json:"segment,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SrExppath_) Reset() { *m = SrExppath_{} }
func (m *SrExppath_) String() string { return proto.CompactTextString(m) }
func (*SrExppath_) ProtoMessage() {}
func (*SrExppath_) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{15}
}
func (m *SrExppath_) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SrExppath_.Unmarshal(m, b)
}
func (m *SrExppath_) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SrExppath_.Marshal(b, m, deterministic)
}
func (m *SrExppath_) XXX_Merge(src proto.Message) {
xxx_messageInfo_SrExppath_.Merge(m, src)
}
func (m *SrExppath_) XXX_Size() int {
return xxx_messageInfo_SrExppath_.Size(m)
}
func (m *SrExppath_) XXX_DiscardUnknown() {
xxx_messageInfo_SrExppath_.DiscardUnknown(m)
}
var xxx_messageInfo_SrExppath_ proto.InternalMessageInfo
func (m *SrExppath_) GetWeight() uint32 {
if m != nil {
return m.Weight
}
return 0
}
func (m *SrExppath_) GetSegment() []*SrSid_ {
if m != nil {
return m.Segment
}
return nil
}
type BgpSrpolicyEntry_ struct {
TunnelEncapType uint32 `protobuf:"varint,1,opt,name=tunnel_encap_type,json=tunnelEncapType,proto3" json:"tunnel_encap_type,omitempty"`
BindingSid *BgpBindingSidT `protobuf:"bytes,2,opt,name=binding_sid,json=bindingSid,proto3" json:"binding_sid,omitempty"`
AllocatedBindingSid *BgpBindingSidT `protobuf:"bytes,3,opt,name=allocated_binding_sid,json=allocatedBindingSid,proto3" json:"allocated_binding_sid,omitempty"`
Preference uint32 `protobuf:"varint,4,opt,name=preference,proto3" json:"preference,omitempty"`
State bool `protobuf:"varint,5,opt,name=state,proto3" json:"state,omitempty"`
RequestState string `protobuf:"bytes,6,opt,name=request_state,json=requestState,proto3" json:"request_state,omitempty"`
SegmentList []*SrExppath_ `protobuf:"bytes,7,rep,name=segment_list,json=segmentList,proto3" json:"segment_list,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpSrpolicyEntry_) Reset() { *m = BgpSrpolicyEntry_{} }
func (m *BgpSrpolicyEntry_) String() string { return proto.CompactTextString(m) }
func (*BgpSrpolicyEntry_) ProtoMessage() {}
func (*BgpSrpolicyEntry_) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{16}
}
func (m *BgpSrpolicyEntry_) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpSrpolicyEntry_.Unmarshal(m, b)
}
func (m *BgpSrpolicyEntry_) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpSrpolicyEntry_.Marshal(b, m, deterministic)
}
func (m *BgpSrpolicyEntry_) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpSrpolicyEntry_.Merge(m, src)
}
func (m *BgpSrpolicyEntry_) XXX_Size() int {
return xxx_messageInfo_BgpSrpolicyEntry_.Size(m)
}
func (m *BgpSrpolicyEntry_) XXX_DiscardUnknown() {
xxx_messageInfo_BgpSrpolicyEntry_.DiscardUnknown(m)
}
var xxx_messageInfo_BgpSrpolicyEntry_ proto.InternalMessageInfo
func (m *BgpSrpolicyEntry_) GetTunnelEncapType() uint32 {
if m != nil {
return m.TunnelEncapType
}
return 0
}
func (m *BgpSrpolicyEntry_) GetBindingSid() *BgpBindingSidT {
if m != nil {
return m.BindingSid
}
return nil
}
func (m *BgpSrpolicyEntry_) GetAllocatedBindingSid() *BgpBindingSidT {
if m != nil {
return m.AllocatedBindingSid
}
return nil
}
func (m *BgpSrpolicyEntry_) GetPreference() uint32 {
if m != nil {
return m.Preference
}
return 0
}
func (m *BgpSrpolicyEntry_) GetState() bool {
if m != nil {
return m.State
}
return false
}
func (m *BgpSrpolicyEntry_) GetRequestState() string {
if m != nil {
return m.RequestState
}
return ""
}
func (m *BgpSrpolicyEntry_) GetSegmentList() []*SrExppath_ {
if m != nil {
return m.SegmentList
}
return nil
}
type BgpTunencapEntry_ struct {
SrPolicy *BgpSrpolicyEntry_ `protobuf:"bytes,1,opt,name=sr_policy,json=srPolicy,proto3" json:"sr_policy,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpTunencapEntry_) Reset() { *m = BgpTunencapEntry_{} }
func (m *BgpTunencapEntry_) String() string { return proto.CompactTextString(m) }
func (*BgpTunencapEntry_) ProtoMessage() {}
func (*BgpTunencapEntry_) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{17}
}
func (m *BgpTunencapEntry_) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpTunencapEntry_.Unmarshal(m, b)
}
func (m *BgpTunencapEntry_) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpTunencapEntry_.Marshal(b, m, deterministic)
}
func (m *BgpTunencapEntry_) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpTunencapEntry_.Merge(m, src)
}
func (m *BgpTunencapEntry_) XXX_Size() int {
return xxx_messageInfo_BgpTunencapEntry_.Size(m)
}
func (m *BgpTunencapEntry_) XXX_DiscardUnknown() {
xxx_messageInfo_BgpTunencapEntry_.DiscardUnknown(m)
}
var xxx_messageInfo_BgpTunencapEntry_ proto.InternalMessageInfo
func (m *BgpTunencapEntry_) GetSrPolicy() *BgpSrpolicyEntry_ {
if m != nil {
return m.SrPolicy
}
return nil
}
type BgpCommonAttrEntry_ struct {
IsMetricPresent bool `protobuf:"varint,1,opt,name=is_metric_present,json=isMetricPresent,proto3" json:"is_metric_present,omitempty"`
IsLocalPrefPresent bool `protobuf:"varint,2,opt,name=is_local_pref_present,json=isLocalPrefPresent,proto3" json:"is_local_pref_present,omitempty"`
IsAtomicAggregatePresent bool `protobuf:"varint,3,opt,name=is_atomic_aggregate_present,json=isAtomicAggregatePresent,proto3" json:"is_atomic_aggregate_present,omitempty"`
IsAggregatorPresent bool `protobuf:"varint,4,opt,name=is_aggregator_present,json=isAggregatorPresent,proto3" json:"is_aggregator_present,omitempty"`
IsOriginPresent bool `protobuf:"varint,5,opt,name=is_origin_present,json=isOriginPresent,proto3" json:"is_origin_present,omitempty"`
IsAsPathPresent bool `protobuf:"varint,6,opt,name=is_as_path_present,json=isAsPathPresent,proto3" json:"is_as_path_present,omitempty"`
IsCommunityPresent bool `protobuf:"varint,7,opt,name=is_community_present,json=isCommunityPresent,proto3" json:"is_community_present,omitempty"`
IsExtendedCommunityPresent bool `protobuf:"varint,8,opt,name=is_extended_community_present,json=isExtendedCommunityPresent,proto3" json:"is_extended_community_present,omitempty"`
IsSsaPresent bool `protobuf:"varint,9,opt,name=is_ssa_present,json=isSsaPresent,proto3" json:"is_ssa_present,omitempty"`
IsConnectorPresent bool `protobuf:"varint,10,opt,name=is_connector_present,json=isConnectorPresent,proto3" json:"is_connector_present,omitempty"`
IsPmsiPresent bool `protobuf:"varint,11,opt,name=is_pmsi_present,json=isPmsiPresent,proto3" json:"is_pmsi_present,omitempty"`
IsPppmpPresent bool `protobuf:"varint,12,opt,name=is_pppmp_present,json=isPppmpPresent,proto3" json:"is_pppmp_present,omitempty"`
IsAigpPresent bool `protobuf:"varint,13,opt,name=is_aigp_present,json=isAigpPresent,proto3" json:"is_aigp_present,omitempty"`
IsPeDistinguisherLabelPresent bool `protobuf:"varint,14,opt,name=is_pe_distinguisher_label_present,json=isPeDistinguisherLabelPresent,proto3" json:"is_pe_distinguisher_label_present,omitempty"`
IsLsAttributePresent bool `protobuf:"varint,15,opt,name=is_ls_attribute_present,json=isLsAttributePresent,proto3" json:"is_ls_attribute_present,omitempty"`
IsLabelIndexPresent bool `protobuf:"varint,16,opt,name=is_label_index_present,json=isLabelIndexPresent,proto3" json:"is_label_index_present,omitempty"`
NeighborAs uint32 `protobuf:"varint,17,opt,name=neighbor_as,json=neighborAs,proto3" json:"neighbor_as,omitempty"`
AggregatorAs uint32 `protobuf:"varint,18,opt,name=aggregator_as,json=aggregatorAs,proto3" json:"aggregator_as,omitempty"`
AggregatorAddress string `protobuf:"bytes,19,opt,name=aggregator_address,json=aggregatorAddress,proto3" json:"aggregator_address,omitempty"`
Metric uint32 `protobuf:"varint,20,opt,name=metric,proto3" json:"metric,omitempty"`
LocalPreference uint32 `protobuf:"varint,21,opt,name=local_preference,json=localPreference,proto3" json:"local_preference,omitempty"`
Origin uint32 `protobuf:"varint,22,opt,name=origin,proto3" json:"origin,omitempty"`
AsPath string `protobuf:"bytes,23,opt,name=as_path,json=asPath,proto3" json:"as_path,omitempty"`
Community []uint32 `protobuf:"varint,24,rep,packed,name=community,proto3" json:"community,omitempty"`
ExtendedCommunityFlags uint32 `protobuf:"varint,25,opt,name=extended_community_flags,json=extendedCommunityFlags,proto3" json:"extended_community_flags,omitempty"`
ExtendedCommunity []uint32 `protobuf:"varint,26,rep,packed,name=extended_community,json=extendedCommunity,proto3" json:"extended_community,omitempty"`
UnknownAttribute []uint32 `protobuf:"varint,27,rep,packed,name=unknown_attribute,json=unknownAttribute,proto3" json:"unknown_attribute,omitempty"`
Cluster []uint32 `protobuf:"varint,28,rep,packed,name=cluster,proto3" json:"cluster,omitempty"`
Originator string `protobuf:"bytes,29,opt,name=originator,proto3" json:"originator,omitempty"`
L2Tpv3SessionId uint32 `protobuf:"varint,30,opt,name=l2tpv3_session_id,json=l2tpv3SessionId,proto3" json:"l2tpv3_session_id,omitempty"`
L2Tpv3Cookie []uint32 `protobuf:"varint,31,rep,packed,name=l2tpv3_cookie,json=l2tpv3Cookie,proto3" json:"l2tpv3_cookie,omitempty"`
ConnectorType uint32 `protobuf:"varint,32,opt,name=connector_type,json=connectorType,proto3" json:"connector_type,omitempty"`
ConnectorValue []uint32 `protobuf:"varint,33,rep,packed,name=connector_value,json=connectorValue,proto3" json:"connector_value,omitempty"`
AigpMetricValue uint64 `protobuf:"varint,34,opt,name=aigp_metric_value,json=aigpMetricValue,proto3" json:"aigp_metric_value,omitempty"`
PmsiType uint32 `protobuf:"varint,35,opt,name=pmsi_type,json=pmsiType,proto3" json:"pmsi_type,omitempty"`
PmsiFlags uint32 `protobuf:"varint,36,opt,name=pmsi_flags,json=pmsiFlags,proto3" json:"pmsi_flags,omitempty"`
PmsiLabel uint32 `protobuf:"varint,37,opt,name=pmsi_label,json=pmsiLabel,proto3" json:"pmsi_label,omitempty"`
PmsiValue []uint32 `protobuf:"varint,38,rep,packed,name=pmsi_value,json=pmsiValue,proto3" json:"pmsi_value,omitempty"`
PpmPvalue uint32 `protobuf:"varint,39,opt,name=ppm_pvalue,json=ppmPvalue,proto3" json:"ppm_pvalue,omitempty"`
PeDistinguisherLabel []*BgpPedistlblEntry_ `protobuf:"bytes,40,rep,name=pe_distinguisher_label,json=peDistinguisherLabel,proto3" json:"pe_distinguisher_label,omitempty"`
LsAttr []uint32 `protobuf:"varint,41,rep,packed,name=ls_attr,json=lsAttr,proto3" json:"ls_attr,omitempty"`
LabelIndexAttr []uint32 `protobuf:"varint,42,rep,packed,name=label_index_attr,json=labelIndexAttr,proto3" json:"label_index_attr,omitempty"`
TunnelEncap *BgpTunencapEntry_ `protobuf:"bytes,43,opt,name=tunnel_encap,json=tunnelEncap,proto3" json:"tunnel_encap,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpCommonAttrEntry_) Reset() { *m = BgpCommonAttrEntry_{} }
func (m *BgpCommonAttrEntry_) String() string { return proto.CompactTextString(m) }
func (*BgpCommonAttrEntry_) ProtoMessage() {}
func (*BgpCommonAttrEntry_) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{18}
}
func (m *BgpCommonAttrEntry_) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpCommonAttrEntry_.Unmarshal(m, b)
}
func (m *BgpCommonAttrEntry_) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpCommonAttrEntry_.Marshal(b, m, deterministic)
}
func (m *BgpCommonAttrEntry_) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpCommonAttrEntry_.Merge(m, src)
}
func (m *BgpCommonAttrEntry_) XXX_Size() int {
return xxx_messageInfo_BgpCommonAttrEntry_.Size(m)
}
func (m *BgpCommonAttrEntry_) XXX_DiscardUnknown() {
xxx_messageInfo_BgpCommonAttrEntry_.DiscardUnknown(m)
}
var xxx_messageInfo_BgpCommonAttrEntry_ proto.InternalMessageInfo
func (m *BgpCommonAttrEntry_) GetIsMetricPresent() bool {
if m != nil {
return m.IsMetricPresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetIsLocalPrefPresent() bool {
if m != nil {
return m.IsLocalPrefPresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetIsAtomicAggregatePresent() bool {
if m != nil {
return m.IsAtomicAggregatePresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetIsAggregatorPresent() bool {
if m != nil {
return m.IsAggregatorPresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetIsOriginPresent() bool {
if m != nil {
return m.IsOriginPresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetIsAsPathPresent() bool {
if m != nil {
return m.IsAsPathPresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetIsCommunityPresent() bool {
if m != nil {
return m.IsCommunityPresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetIsExtendedCommunityPresent() bool {
if m != nil {
return m.IsExtendedCommunityPresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetIsSsaPresent() bool {
if m != nil {
return m.IsSsaPresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetIsConnectorPresent() bool {
if m != nil {
return m.IsConnectorPresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetIsPmsiPresent() bool {
if m != nil {
return m.IsPmsiPresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetIsPppmpPresent() bool {
if m != nil {
return m.IsPppmpPresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetIsAigpPresent() bool {
if m != nil {
return m.IsAigpPresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetIsPeDistinguisherLabelPresent() bool {
if m != nil {
return m.IsPeDistinguisherLabelPresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetIsLsAttributePresent() bool {
if m != nil {
return m.IsLsAttributePresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetIsLabelIndexPresent() bool {
if m != nil {
return m.IsLabelIndexPresent
}
return false
}
func (m *BgpCommonAttrEntry_) GetNeighborAs() uint32 {
if m != nil {
return m.NeighborAs
}
return 0
}
func (m *BgpCommonAttrEntry_) GetAggregatorAs() uint32 {
if m != nil {
return m.AggregatorAs
}
return 0
}
func (m *BgpCommonAttrEntry_) GetAggregatorAddress() string {
if m != nil {
return m.AggregatorAddress
}
return ""
}
func (m *BgpCommonAttrEntry_) GetMetric() uint32 {
if m != nil {
return m.Metric
}
return 0
}
func (m *BgpCommonAttrEntry_) GetLocalPreference() uint32 {
if m != nil {
return m.LocalPreference
}
return 0
}
func (m *BgpCommonAttrEntry_) GetOrigin() uint32 {
if m != nil {
return m.Origin
}
return 0
}
func (m *BgpCommonAttrEntry_) GetAsPath() string {
if m != nil {
return m.AsPath
}
return ""
}
func (m *BgpCommonAttrEntry_) GetCommunity() []uint32 {
if m != nil {
return m.Community
}
return nil
}
func (m *BgpCommonAttrEntry_) GetExtendedCommunityFlags() uint32 {
if m != nil {
return m.ExtendedCommunityFlags
}
return 0
}
func (m *BgpCommonAttrEntry_) GetExtendedCommunity() []uint32 {
if m != nil {
return m.ExtendedCommunity
}
return nil
}
func (m *BgpCommonAttrEntry_) GetUnknownAttribute() []uint32 {
if m != nil {
return m.UnknownAttribute
}
return nil
}
func (m *BgpCommonAttrEntry_) GetCluster() []uint32 {
if m != nil {
return m.Cluster
}
return nil
}
func (m *BgpCommonAttrEntry_) GetOriginator() string {
if m != nil {
return m.Originator
}
return ""
}
func (m *BgpCommonAttrEntry_) GetL2Tpv3SessionId() uint32 {
if m != nil {
return m.L2Tpv3SessionId
}
return 0
}
func (m *BgpCommonAttrEntry_) GetL2Tpv3Cookie() []uint32 {
if m != nil {
return m.L2Tpv3Cookie
}
return nil
}
func (m *BgpCommonAttrEntry_) GetConnectorType() uint32 {
if m != nil {
return m.ConnectorType
}
return 0
}
func (m *BgpCommonAttrEntry_) GetConnectorValue() []uint32 {
if m != nil {
return m.ConnectorValue
}
return nil
}
func (m *BgpCommonAttrEntry_) GetAigpMetricValue() uint64 {
if m != nil {
return m.AigpMetricValue
}
return 0
}
func (m *BgpCommonAttrEntry_) GetPmsiType() uint32 {
if m != nil {
return m.PmsiType
}
return 0
}
func (m *BgpCommonAttrEntry_) GetPmsiFlags() uint32 {
if m != nil {
return m.PmsiFlags
}
return 0
}
func (m *BgpCommonAttrEntry_) GetPmsiLabel() uint32 {
if m != nil {
return m.PmsiLabel
}
return 0
}
func (m *BgpCommonAttrEntry_) GetPmsiValue() []uint32 {
if m != nil {
return m.PmsiValue
}
return nil
}
func (m *BgpCommonAttrEntry_) GetPpmPvalue() uint32 {
if m != nil {
return m.PpmPvalue
}
return 0
}
func (m *BgpCommonAttrEntry_) GetPeDistinguisherLabel() []*BgpPedistlblEntry_ {
if m != nil {
return m.PeDistinguisherLabel
}
return nil
}
func (m *BgpCommonAttrEntry_) GetLsAttr() []uint32 {
if m != nil {
return m.LsAttr
}
return nil
}
func (m *BgpCommonAttrEntry_) GetLabelIndexAttr() []uint32 {
if m != nil {
return m.LabelIndexAttr
}
return nil
}
func (m *BgpCommonAttrEntry_) GetTunnelEncap() *BgpTunencapEntry_ {
if m != nil {
return m.TunnelEncap
}
return nil
}
type BgpAttrRnhAddrT struct {
Len string `protobuf:"bytes,1,opt,name=len,proto3" json:"len,omitempty"`
Ipv4Address string `protobuf:"bytes,2,opt,name=ipv4_address,json=ipv4Address,proto3" json:"ipv4_address,omitempty"`
Ipv6Address string `protobuf:"bytes,3,opt,name=ipv6_address,json=ipv6Address,proto3" json:"ipv6_address,omitempty"`
MacAddress string `protobuf:"bytes,4,opt,name=mac_address,json=macAddress,proto3" json:"mac_address,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpAttrRnhAddrT) Reset() { *m = BgpAttrRnhAddrT{} }
func (m *BgpAttrRnhAddrT) String() string { return proto.CompactTextString(m) }
func (*BgpAttrRnhAddrT) ProtoMessage() {}
func (*BgpAttrRnhAddrT) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{19}
}
func (m *BgpAttrRnhAddrT) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpAttrRnhAddrT.Unmarshal(m, b)
}
func (m *BgpAttrRnhAddrT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpAttrRnhAddrT.Marshal(b, m, deterministic)
}
func (m *BgpAttrRnhAddrT) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpAttrRnhAddrT.Merge(m, src)
}
func (m *BgpAttrRnhAddrT) XXX_Size() int {
return xxx_messageInfo_BgpAttrRnhAddrT.Size(m)
}
func (m *BgpAttrRnhAddrT) XXX_DiscardUnknown() {
xxx_messageInfo_BgpAttrRnhAddrT.DiscardUnknown(m)
}
var xxx_messageInfo_BgpAttrRnhAddrT proto.InternalMessageInfo
func (m *BgpAttrRnhAddrT) GetLen() string {
if m != nil {
return m.Len
}
return ""
}
func (m *BgpAttrRnhAddrT) GetIpv4Address() string {
if m != nil {
return m.Ipv4Address
}
return ""
}
func (m *BgpAttrRnhAddrT) GetIpv6Address() string {
if m != nil {
return m.Ipv6Address
}
return ""
}
func (m *BgpAttrRnhAddrT) GetMacAddress() string {
if m != nil {
return m.MacAddress
}
return ""
}
type BgpAttr_ struct {
IsAsPath2Byte bool `protobuf:"varint,1,opt,name=is_as_path2_byte,json=isAsPath2Byte,proto3" json:"is_as_path2_byte,omitempty"`
IsApplicationGatewayPresent bool `protobuf:"varint,2,opt,name=is_application_gateway_present,json=isApplicationGatewayPresent,proto3" json:"is_application_gateway_present,omitempty"`
IsAttrSetPresent bool `protobuf:"varint,3,opt,name=is_attr_set_present,json=isAttrSetPresent,proto3" json:"is_attr_set_present,omitempty"`
SetAigpInboundIgp bool `protobuf:"varint,4,opt,name=set_aigp_inbound_igp,json=setAigpInboundIgp,proto3" json:"set_aigp_inbound_igp,omitempty"`
SetAigpInboundMetric bool `protobuf:"varint,5,opt,name=set_aigp_inbound_metric,json=setAigpInboundMetric,proto3" json:"set_aigp_inbound_metric,omitempty"`
IsRnhPresent bool `protobuf:"varint,6,opt,name=is_rnh_present,json=isRnhPresent,proto3" json:"is_rnh_present,omitempty"`
IsRibrnhPresent bool `protobuf:"varint,7,opt,name=is_ribrnh_present,json=isRibrnhPresent,proto3" json:"is_ribrnh_present,omitempty"`
AttributeKeyNumber uint32 `protobuf:"varint,8,opt,name=attribute_key_number,json=attributeKeyNumber,proto3" json:"attribute_key_number,omitempty"`
AttributeReuseIdConfig bool `protobuf:"varint,9,opt,name=attribute_reuse_id_config,json=attributeReuseIdConfig,proto3" json:"attribute_reuse_id_config,omitempty"`
AttributeReuseIdMaxId uint32 `protobuf:"varint,10,opt,name=attribute_reuse_id_max_id,json=attributeReuseIdMaxId,proto3" json:"attribute_reuse_id_max_id,omitempty"`
AttributeReuseIdNode uint32 `protobuf:"varint,11,opt,name=attribute_reuse_id_node,json=attributeReuseIdNode,proto3" json:"attribute_reuse_id_node,omitempty"`
AttributeReuseIdCurrent uint32 `protobuf:"varint,12,opt,name=attribute_reuse_id_current,json=attributeReuseIdCurrent,proto3" json:"attribute_reuse_id_current,omitempty"`
AttributeReuseIdKeys uint32 `protobuf:"varint,13,opt,name=attribute_reuse_id_keys,json=attributeReuseIdKeys,proto3" json:"attribute_reuse_id_keys,omitempty"`
AttributeReuseIdRecoverSec uint32 `protobuf:"varint,14,opt,name=attribute_reuse_id_recover_sec,json=attributeReuseIdRecoverSec,proto3" json:"attribute_reuse_id_recover_sec,omitempty"`
VpnDistinguisher uint32 `protobuf:"varint,15,opt,name=vpn_distinguisher,json=vpnDistinguisher,proto3" json:"vpn_distinguisher,omitempty"`
CommonAttributes *BgpCommonAttrEntry_ `protobuf:"bytes,16,opt,name=common_attributes,json=commonAttributes,proto3" json:"common_attributes,omitempty"`
AttrSet *BgpCommonAttrEntry_ `protobuf:"bytes,17,opt,name=attr_set,json=attrSet,proto3" json:"attr_set,omitempty"`
RnhType uint32 `protobuf:"varint,18,opt,name=rnh_type,json=rnhType,proto3" json:"rnh_type,omitempty"`
RnhLen uint32 `protobuf:"varint,19,opt,name=rnh_len,json=rnhLen,proto3" json:"rnh_len,omitempty"`
RnhAddrLen uint32 `protobuf:"varint,20,opt,name=rnh_addr_len,json=rnhAddrLen,proto3" json:"rnh_addr_len,omitempty"`
RnhAddr *BgpAttrRnhAddrT `protobuf:"bytes,21,opt,name=rnh_addr,json=rnhAddr,proto3" json:"rnh_addr,omitempty"`
RibrnhTable uint32 `protobuf:"varint,22,opt,name=ribrnh_table,json=ribrnhTable,proto3" json:"ribrnh_table,omitempty"`
RibrnhMac string `protobuf:"bytes,23,opt,name=ribrnh_mac,json=ribrnhMac,proto3" json:"ribrnh_mac,omitempty"`
RibrnhIp *BgpAddrtype `protobuf:"bytes,24,opt,name=ribrnh_ip,json=ribrnhIp,proto3" json:"ribrnh_ip,omitempty"`
RibrnhipTable uint32 `protobuf:"varint,25,opt,name=ribrnhip_table,json=ribrnhipTable,proto3" json:"ribrnhip_table,omitempty"`
RibrnhVni uint32 `protobuf:"varint,26,opt,name=ribrnh_vni,json=ribrnhVni,proto3" json:"ribrnh_vni,omitempty"`
RibrnhEncap uint32 `protobuf:"varint,27,opt,name=ribrnh_encap,json=ribrnhEncap,proto3" json:"ribrnh_encap,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpAttr_) Reset() { *m = BgpAttr_{} }
func (m *BgpAttr_) String() string { return proto.CompactTextString(m) }
func (*BgpAttr_) ProtoMessage() {}
func (*BgpAttr_) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{20}
}
func (m *BgpAttr_) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpAttr_.Unmarshal(m, b)
}
func (m *BgpAttr_) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpAttr_.Marshal(b, m, deterministic)
}
func (m *BgpAttr_) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpAttr_.Merge(m, src)
}
func (m *BgpAttr_) XXX_Size() int {
return xxx_messageInfo_BgpAttr_.Size(m)
}
func (m *BgpAttr_) XXX_DiscardUnknown() {
xxx_messageInfo_BgpAttr_.DiscardUnknown(m)
}
var xxx_messageInfo_BgpAttr_ proto.InternalMessageInfo
func (m *BgpAttr_) GetIsAsPath2Byte() bool {
if m != nil {
return m.IsAsPath2Byte
}
return false
}
func (m *BgpAttr_) GetIsApplicationGatewayPresent() bool {
if m != nil {
return m.IsApplicationGatewayPresent
}
return false
}
func (m *BgpAttr_) GetIsAttrSetPresent() bool {
if m != nil {
return m.IsAttrSetPresent
}
return false
}
func (m *BgpAttr_) GetSetAigpInboundIgp() bool {
if m != nil {
return m.SetAigpInboundIgp
}
return false
}
func (m *BgpAttr_) GetSetAigpInboundMetric() bool {
if m != nil {
return m.SetAigpInboundMetric
}
return false
}
func (m *BgpAttr_) GetIsRnhPresent() bool {
if m != nil {
return m.IsRnhPresent
}
return false
}
func (m *BgpAttr_) GetIsRibrnhPresent() bool {
if m != nil {
return m.IsRibrnhPresent
}
return false
}
func (m *BgpAttr_) GetAttributeKeyNumber() uint32 {
if m != nil {
return m.AttributeKeyNumber
}
return 0
}
func (m *BgpAttr_) GetAttributeReuseIdConfig() bool {
if m != nil {
return m.AttributeReuseIdConfig
}
return false
}
func (m *BgpAttr_) GetAttributeReuseIdMaxId() uint32 {
if m != nil {
return m.AttributeReuseIdMaxId
}
return 0
}
func (m *BgpAttr_) GetAttributeReuseIdNode() uint32 {
if m != nil {
return m.AttributeReuseIdNode
}
return 0
}
func (m *BgpAttr_) GetAttributeReuseIdCurrent() uint32 {
if m != nil {
return m.AttributeReuseIdCurrent
}
return 0
}
func (m *BgpAttr_) GetAttributeReuseIdKeys() uint32 {
if m != nil {
return m.AttributeReuseIdKeys
}
return 0
}
func (m *BgpAttr_) GetAttributeReuseIdRecoverSec() uint32 {
if m != nil {
return m.AttributeReuseIdRecoverSec
}
return 0
}
func (m *BgpAttr_) GetVpnDistinguisher() uint32 {
if m != nil {
return m.VpnDistinguisher
}
return 0
}
func (m *BgpAttr_) GetCommonAttributes() *BgpCommonAttrEntry_ {
if m != nil {
return m.CommonAttributes
}
return nil
}
func (m *BgpAttr_) GetAttrSet() *BgpCommonAttrEntry_ {
if m != nil {
return m.AttrSet
}
return nil
}
func (m *BgpAttr_) GetRnhType() uint32 {
if m != nil {
return m.RnhType
}
return 0
}
func (m *BgpAttr_) GetRnhLen() uint32 {
if m != nil {
return m.RnhLen
}
return 0
}
func (m *BgpAttr_) GetRnhAddrLen() uint32 {
if m != nil {
return m.RnhAddrLen
}
return 0
}
func (m *BgpAttr_) GetRnhAddr() *BgpAttrRnhAddrT {
if m != nil {
return m.RnhAddr
}
return nil
}
func (m *BgpAttr_) GetRibrnhTable() uint32 {
if m != nil {
return m.RibrnhTable
}
return 0
}
func (m *BgpAttr_) GetRibrnhMac() string {
if m != nil {
return m.RibrnhMac
}
return ""
}
func (m *BgpAttr_) GetRibrnhIp() *BgpAddrtype {
if m != nil {
return m.RibrnhIp
}
return nil
}
func (m *BgpAttr_) GetRibrnhipTable() uint32 {
if m != nil {
return m.RibrnhipTable
}
return 0
}
func (m *BgpAttr_) GetRibrnhVni() uint32 {
if m != nil {
return m.RibrnhVni
}
return 0
}
func (m *BgpAttr_) GetRibrnhEncap() uint32 {
if m != nil {
return m.RibrnhEncap
}
return 0
}
type BgpPathBag struct {
NoPath bool `protobuf:"varint,50,opt,name=no_path,json=noPath,proto3" json:"no_path,omitempty"`
AfName string `protobuf:"bytes,51,opt,name=af_name,json=afName,proto3" json:"af_name,omitempty"`
NeighborAddressXr *BgpAddrtype `protobuf:"bytes,52,opt,name=neighbor_address_xr,json=neighborAddressXr,proto3" json:"neighbor_address_xr,omitempty"`
ProcessInstanceId uint32 `protobuf:"varint,53,opt,name=process_instance_id,json=processInstanceId,proto3" json:"process_instance_id,omitempty"`
LabelOor bool `protobuf:"varint,54,opt,name=label_oor,json=labelOor,proto3" json:"label_oor,omitempty"`
LabelOOrVersion uint32 `protobuf:"varint,55,opt,name=label_o_or_version,json=labelOOrVersion,proto3" json:"label_o_or_version,omitempty"`
LabelFail bool `protobuf:"varint,56,opt,name=label_fail,json=labelFail,proto3" json:"label_fail,omitempty"`
PathInformation *BgpPath_ `protobuf:"bytes,57,opt,name=path_information,json=pathInformation,proto3" json:"path_information,omitempty"`
AttributesAfterPolicyIn *BgpAttr_ `protobuf:"bytes,58,opt,name=attributes_after_policy_in,json=attributesAfterPolicyIn,proto3" json:"attributes_after_policy_in,omitempty"`
RouteDistinguisher string `protobuf:"bytes,59,opt,name=route_distinguisher,json=routeDistinguisher,proto3" json:"route_distinguisher,omitempty"`
SourceRouteDistinguisher string `protobuf:"bytes,60,opt,name=source_route_distinguisher,json=sourceRouteDistinguisher,proto3" json:"source_route_distinguisher,omitempty"`
PrefixVersion uint32 `protobuf:"varint,61,opt,name=prefix_version,json=prefixVersion,proto3" json:"prefix_version,omitempty"`
VrfName string `protobuf:"bytes,62,opt,name=vrf_name,json=vrfName,proto3" json:"vrf_name,omitempty"`
SourceVrfName string `protobuf:"bytes,63,opt,name=source_vrf_name,json=sourceVrfName,proto3" json:"source_vrf_name,omitempty"`
SrcafName string `protobuf:"bytes,64,opt,name=srcaf_name,json=srcafName,proto3" json:"srcaf_name,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BgpPathBag) Reset() { *m = BgpPathBag{} }
func (m *BgpPathBag) String() string { return proto.CompactTextString(m) }
func (*BgpPathBag) ProtoMessage() {}
func (*BgpPathBag) Descriptor() ([]byte, []int) {
return fileDescriptor_bb29889f75ad586c, []int{21}
}
func (m *BgpPathBag) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BgpPathBag.Unmarshal(m, b)
}
func (m *BgpPathBag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BgpPathBag.Marshal(b, m, deterministic)
}
func (m *BgpPathBag) XXX_Merge(src proto.Message) {
xxx_messageInfo_BgpPathBag.Merge(m, src)
}
func (m *BgpPathBag) XXX_Size() int {
return xxx_messageInfo_BgpPathBag.Size(m)
}
func (m *BgpPathBag) XXX_DiscardUnknown() {
xxx_messageInfo_BgpPathBag.DiscardUnknown(m)
}
var xxx_messageInfo_BgpPathBag proto.InternalMessageInfo
func (m *BgpPathBag) GetNoPath() bool {
if m != nil {
return m.NoPath
}
return false
}
func (m *BgpPathBag) GetAfName() string {
if m != nil {
return m.AfName
}
return ""
}
func (m *BgpPathBag) GetNeighborAddressXr() *BgpAddrtype {
if m != nil {
return m.NeighborAddressXr
}
return nil
}
func (m *BgpPathBag) GetProcessInstanceId() uint32 {
if m != nil {
return m.ProcessInstanceId
}
return 0
}
func (m *BgpPathBag) GetLabelOor() bool {
if m != nil {
return m.LabelOor
}
return false
}
func (m *BgpPathBag) GetLabelOOrVersion() uint32 {
if m != nil {
return m.LabelOOrVersion
}
return 0
}
func (m *BgpPathBag) GetLabelFail() bool {
if m != nil {
return m.LabelFail
}
return false
}
func (m *BgpPathBag) GetPathInformation() *BgpPath_ {
if m != nil {
return m.PathInformation
}
return nil
}
func (m *BgpPathBag) GetAttributesAfterPolicyIn() *BgpAttr_ {
if m != nil {
return m.AttributesAfterPolicyIn
}
return nil
}
func (m *BgpPathBag) GetRouteDistinguisher() string {
if m != nil {
return m.RouteDistinguisher
}
return ""
}
func (m *BgpPathBag) GetSourceRouteDistinguisher() string {
if m != nil {
return m.SourceRouteDistinguisher
}
return ""
}
func (m *BgpPathBag) GetPrefixVersion() uint32 {
if m != nil {
return m.PrefixVersion
}
return 0
}
func (m *BgpPathBag) GetVrfName() string {
if m != nil {
return m.VrfName
}
return ""
}
func (m *BgpPathBag) GetSourceVrfName() string {
if m != nil {
return m.SourceVrfName
}
return ""
}
func (m *BgpPathBag) GetSrcafName() string {
if m != nil {
return m.SrcafName
}
return ""
}
func init() {
proto.RegisterType((*BgpPathBag_KEYS)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_path_bag_KEYS")
proto.RegisterType((*BgpL2VpnAddrT)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_l2vpn_addr_t")
proto.RegisterType((*BgpL2VpnMspwAddrT)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_l2vpn_mspw_addr_t")
proto.RegisterType((*BgpIpv4SrpolicyAddrT)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_ipv4_srpolicy_addr_t")
proto.RegisterType((*BgpIpv6SrpolicyAddrT)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_ipv6_srpolicy_addr_t")
proto.RegisterType((*BgpAddrtype)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_addrtype")
proto.RegisterType((*BgpPrefixtype)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_prefixtype")
proto.RegisterType((*BgpTeTunnel)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_te_tunnel")
proto.RegisterType((*BgpL2VpnEvpnEsiT)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_l2vpn_evpn_esi_t")
proto.RegisterType((*BgpV4V6T)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_v4_v6_t")
proto.RegisterType((*BgpAdvinfoType_)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_advinfo_type_")
proto.RegisterType((*BgpPath_)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_path_")
proto.RegisterType((*BgpPedistlblEntry_)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_pedistlbl_entry_")
proto.RegisterType((*BgpBindingSidT)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_binding_sid_t")
proto.RegisterType((*SrSid_)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.sr_sid_")
proto.RegisterType((*SrExppath_)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.sr_exppath_")
proto.RegisterType((*BgpSrpolicyEntry_)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_srpolicy_entry_")
proto.RegisterType((*BgpTunencapEntry_)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_tunencap_entry_")
proto.RegisterType((*BgpCommonAttrEntry_)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_common_attr_entry_")
proto.RegisterType((*BgpAttrRnhAddrT)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_attr_rnh_addr_t")
proto.RegisterType((*BgpAttr_)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_attr_")
proto.RegisterType((*BgpPathBag)(nil), "cisco_ios_xr_ipv4_bgp_oper.bgp.instances.instance.instance_active.default_vrf.afs.af.dampenings.dampening.bgp_path_bag")
}
func init() { proto.RegisterFile("bgp_path_bag.proto", fileDescriptor_bb29889f75ad586c) }
var fileDescriptor_bb29889f75ad586c = []byte{
// 5142 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5c, 0xeb, 0x6f, 0x1c, 0xc9,
0x71, 0xc7, 0x4a, 0x3a, 0x72, 0xd9, 0xe4, 0xf2, 0x31, 0x7c, 0x68, 0xf4, 0xa6, 0xf6, 0x4e, 0x27,
0xe9, 0x1e, 0x92, 0x8f, 0x27, 0xf3, 0x9e, 0x3e, 0x1f, 0x45, 0x51, 0xa7, 0xf5, 0x49, 0x14, 0x33,
0xab, 0xd3, 0xd9, 0x79, 0x8d, 0x67, 0x67, 0x7a, 0x77, 0x3b, 0x9c, 0xe9, 0x99, 0xeb, 0x9e, 0x5d,
0x92, 0x4e, 0x90, 0x07, 0xf2, 0x31, 0x86, 0x0d, 0x04, 0x09, 0x10, 0xc3, 0x31, 0x02, 0x23, 0x08,
0x12, 0x24, 0x01, 0x2e, 0x46, 0x12, 0x24, 0x40, 0xfe, 0x80, 0x7c, 0xc9, 0x97, 0xfc, 0x47, 0x41,
0x55, 0x75, 0xcf, 0xcc, 0x2e, 0x57, 0x81, 0xfd, 0x21, 0xa4, 0xf2, 0x41, 0x00, 0xa7, 0xea, 0x57,
0xdd, 0xd5, 0xcf, 0xfa, 0x55, 0x77, 0xaf, 0x98, 0xd3, 0xe9, 0x65, 0x7e, 0x16, 0xe4, 0x7d, 0xbf,
0x13, 0xf4, 0xee, 0x64, 0x2a, 0xcd, 0x53, 0x47, 0x84, 0x42, 0x87, 0xa9, 0x2f, 0x52, 0xed, 0x1f,
0x2a, 0x5f, 0x64, 0xc3, 0x7b, 0x3e, 0xa0, 0xd2, 0x8c, 0xab, 0x3b, 0x9d, 0x5e, 0x76, 0x47, 0x48,
0x9d, 0x07, 0x32, 0xe4, 0xba, 0xf8, 0xab, 0xf8, 0xc3, 0x0f, 0xc2, 0x5c, 0x0c, 0xf9, 0x9d, 0x88,
0x77, 0x83, 0x41, 0x9c, 0xfb, 0x43, 0xd5, 0xbd, 0x13, 0x74, 0xf5, 0x9d, 0xa0, 0x7b, 0x27, 0x0a,
0x92, 0x8c, 0x4b, 0x21, 0x7b, 0xba, 0xfc, 0xb3, 0xf9, 0xc3, 0x33, 0x6c, 0xa9, 0xea, 0x81, 0xff,
0xf9, 0xce, 0xf7, 0xda, 0xce, 0xab, 0xac, 0x51, 0x14, 0x28, 0x83, 0x84, 0xbb, 0xb5, 0xf5, 0xda,
0xad, 0x19, 0x6f, 0xce, 0x0a, 0x77, 0x83, 0x84, 0x3b, 0xe7, 0xd9, 0x74, 0xd0, 0x25, 0xf5, 0x19,
0x54, 0x4f, 0x05, 0x5d, 0x54, 0xac, 0xb0, 0x57, 0x14, 0x1f, 0x68, 0xee, 0x9e, 0x5d, 0xaf, 0xdd,
0x6a, 0x78, 0xf4, 0xe1, 0xb8, 0x6c, 0x7a, 0xc8, 0x95, 0x16, 0xa9, 0x74, 0xcf, 0xa1, 0xdc, 0x7e,
0x3a, 0xf3, 0xec, 0x8c, 0x8a, 0xdc, 0x57, 0xb0, 0x8c, 0x33, 0x2a, 0x02, 0xa4, 0xe4, 0xf9, 0x41,
0xaa, 0xf6, 0xdd, 0x29, 0x14, 0xda, 0x4f, 0xe7, 0x36, 0x5b, 0x94, 0x5c, 0xf4, 0xfa, 0x9d, 0x54,
0xf9, 0x41, 0x14, 0x29, 0xae, 0xb5, 0x3b, 0x8d, 0x90, 0x05, 0x2b, 0xdf, 0x22, 0xb1, 0x73, 0x89,
0xcd, 0xe8, 0x74, 0xa0, 0x42, 0xee, 0xab, 0xc8, 0xad, 0x23, 0xa6, 0x4e, 0x02, 0x2f, 0x02, 0xd7,
0xb1, 0xc1, 0x22, 0x72, 0x67, 0xd0, 0x97, 0x29, 0xf8, 0x6c, 0x45, 0xcd, 0xf7, 0xd8, 0x22, 0xf4,
0x46, 0xbc, 0x31, 0xcc, 0x24, 0xd6, 0xe0, 0xe7, 0xd0, 0x19, 0xe5, 0x37, 0xd4, 0x58, 0x5b, 0x3f,
0x7b, 0xab, 0xe1, 0xcd, 0xa1, 0xd0, 0x54, 0xd7, 0xfc, 0x98, 0xad, 0x96, 0x86, 0x89, 0xce, 0x0e,
0x7e, 0x25, 0xeb, 0x5d, 0xe6, 0x82, 0x35, 0x8e, 0xb4, 0x56, 0x59, 0x1a, 0x8b, 0xf0, 0xc8, 0x16,
0xb0, 0xc1, 0x56, 0x8f, 0xcb, 0xcb, 0x82, 0x96, 0x41, 0xd9, 0x36, 0xba, 0xe3, 0xe5, 0x6d, 0xbe,
0xa0, 0xbc, 0xcd, 0xff, 0xad, 0xbc, 0xcd, 0xf1, 0xf2, 0xfe, 0xa3, 0xc1, 0xe6, 0xa0, 0x40, 0x80,
0xe6, 0x47, 0x19, 0x77, 0x16, 0xd9, 0xd9, 0xa0, 0x2b, 0xcc, 0xb4, 0x80, 0x3f, 0x9d, 0xeb, 0x6c,
0x0e, 0xdd, 0xb4, 0xa5, 0xd1, 0x94, 0x98, 0x05, 0x99, 0x1d, 0x92, 0xb7, 0x98, 0x83, 0x90, 0x24,
0x0c, 0x74, 0x5e, 0x00, 0xcf, 0x22, 0x70, 0x11, 0x34, 0x4f, 0x40, 0x31, 0x8e, 0x8e, 0x83, 0x0e,
0x8f, 0x0b, 0xf4, 0xb9, 0x12, 0xfd, 0x18, 0x14, 0x16, 0x7d, 0x87, 0x61, 0x47, 0xf8, 0xf9, 0x40,
0xca, 0x0a, 0x9c, 0x26, 0xd5, 0x12, 0xa8, 0x9e, 0xa1, 0xc6, 0xe2, 0x6f, 0xb2, 0x05, 0x10, 0x26,
0x51, 0xe9, 0x08, 0xcd, 0xb5, 0x79, 0x23, 0x1e, 0x03, 0x56, 0x47, 0x70, 0xba, 0x04, 0x96, 0x63,
0xe8, 0xbc, 0xc3, 0x56, 0x8c, 0x24, 0xa0, 0x16, 0x1a, 0x34, 0xcd, 0xbd, 0x65, 0xab, 0x7b, 0x52,
0xaa, 0x4c, 0x9f, 0x6d, 0x16, 0x05, 0xcf, 0x14, 0x7d, 0xb6, 0x39, 0xda, 0x0b, 0x9b, 0x63, 0x7d,
0xc6, 0x8a, 0x5e, 0xd8, 0x9c, 0xd0, 0x67, 0x9b, 0x63, 0x7d, 0x36, 0x5b, 0xa2, 0x47, 0xfa, 0x8c,
0x9a, 0xb6, 0x59, 0x6d, 0xda, 0x5c, 0xd1, 0xb4, 0xcd, 0x4a, 0xd3, 0xcc, 0x94, 0xc1, 0xa9, 0x3d,
0xe2, 0x47, 0xa3, 0x68, 0x1b, 0x28, 0x47, 0x5c, 0xf9, 0xbb, 0x1a, 0x5b, 0xc2, 0x39, 0x3e, 0xcc,
0x62, 0x5d, 0x18, 0xcc, 0xaf, 0xd7, 0x6e, 0xcd, 0x6e, 0xfc, 0xee, 0x9d, 0x13, 0xdb, 0xe0, 0xee,
0x8c, 0x2f, 0x67, 0x6f, 0xb1, 0xf0, 0xaa, 0xd2, 0x3c, 0x95, 0xfb, 0x61, 0x2a, 0x75, 0xae, 0x02,
0x21, 0xcb, 0xe6, 0x2d, 0x50, 0xf3, 0x54, 0xbe, 0x5d, 0xe8, 0xac, 0xcd, 0x6d, 0x86, 0xfd, 0x99,
0x54, 0x3b, 0x6f, 0x91, 0x76, 0x22, 0x2b, 0x1f, 0x85, 0xde, 0x1b, 0x81, 0x2e, 0x15, 0xd0, 0x7b,
0x55, 0xe8, 0x5b, 0xcc, 0x21, 0x5f, 0x79, 0x15, 0xec, 0xd0, 0xf8, 0xa1, 0x66, 0xa7, 0x82, 0x6e,
0xb2, 0x46, 0xac, 0xfd, 0x4a, 0xef, 0x2e, 0xd3, 0xfc, 0x89, 0xf5, 0xe3, 0xa2, 0x6d, 0x5f, 0xd7,
0x6c, 0x91, 0xc5, 0xa6, 0x04, 0xc8, 0x15, 0x1c, 0x87, 0x3f, 0xac, 0x9d, 0xca, 0x40, 0x54, 0xb6,
0x47, 0xd3, 0xaa, 0x27, 0x3a, 0x3b, 0x18, 0x9d, 0x6c, 0xf7, 0xfc, 0x6e, 0x9c, 0x1e, 0xe8, 0x8c,
0x87, 0x85, 0xcf, 0xab, 0xe5, 0x42, 0x7a, 0x68, 0x74, 0x63, 0x13, 0xf4, 0xb8, 0xcd, 0x5a, 0x39,
0x41, 0xc7, 0x6d, 0xde, 0x67, 0xae, 0x5d, 0xd8, 0xc7, 0xcc, 0xce, 0xa3, 0xd9, 0x9a, 0xd1, 0x4f,
0xb6, 0xdc, 0x9c, 0x68, 0xe9, 0x16, 0x96, 0x9b, 0x13, 0x2c, 0xff, 0xbd, 0x46, 0x8d, 0xd3, 0xca,
0x1f, 0xdb, 0x7c, 0x2f, 0xe0, 0x80, 0xfc, 0xf1, 0x49, 0x0f, 0xc8, 0xa4, 0x88, 0x43, 0x5d, 0xac,
0xd5, 0x5e, 0x35, 0x04, 0x58, 0xd7, 0x37, 0x8f, 0xbb, 0x7e, 0xf1, 0xd4, 0x5c, 0xdf, 0x9c, 0xe8,
0xfa, 0xe6, 0x98, 0xeb, 0xcd, 0xff, 0xac, 0xb1, 0x79, 0xe4, 0x38, 0x8a, 0x77, 0xc5, 0x21, 0xc6,
0xaf, 0x1f, 0xd7, 0xd8, 0x14, 0x7d, 0x62, 0x0c, 0x9b, 0xdd, 0x38, 0x38, 0x61, 0xef, 0x6d, 0x24,
0xf5, 0x8c, 0x1b, 0xc0, 0x13, 0xe8, 0x2f, 0x3f, 0xe6, 0xb2, 0x97, 0xf7, 0x31, 0x80, 0x36, 0xbc,
0x39, 0x12, 0x3e, 0x46, 0x59, 0xf3, 0xbf, 0xce, 0xb2, 0x06, 0x58, 0xe7, 0xdc, 0x04, 0x3a, 0xe7,
0x1a, 0x9b, 0x35, 0x21, 0x0f, 0x4a, 0x33, 0x01, 0x99, 0x91, 0xe8, 0x19, 0xb4, 0xb4, 0x04, 0x18,
0xa6, 0x06, 0x41, 0xde, 0x00, 0x90, 0xad, 0x5d, 0x61, 0xac, 0x1f, 0x68, 0x53, 0x1e, 0x46, 0xe3,
0xba, 0x37, 0xd3, 0x0f, 0x34, 0xc5, 0x4b, 0x67, 0x9d, 0xcd, 0x09, 0xab, 0xf5, 0x07, 0x19, 0x06,
0xe0, 0xba, 0xc7, 0x84, 0xd1, 0x7f, 0x91, 0x39, 0x77, 0xd9, 0x4a, 0x89, 0x10, 0xb2, 0x9b, 0xfa,
0x3a, 0x0f, 0x62, 0x8e, 0xb1, 0xb7, 0xee, 0x2d, 0x59, 0x64, 0x4b, 0x76, 0xd3, 0x36, 0x28, 0x9c,
0x6f, 0x54, 0x0d, 0x14, 0xef, 0x09, 0x9d, 0x73, 0xc5, 0x23, 0x0c, 0xc0, 0x75, 0xcf, 0xb1, 0x06,
0x5e, 0xa1, 0x81, 0x7d, 0xd1, 0xc0, 0x87, 0x9b, 0xbe, 0xe2, 0x5f, 0x0d, 0x04, 0xe0, 0xa7, 0x11,
0xbf, 0x48, 0x9a, 0xe7, 0x9b, 0x9e, 0x91, 0x3b, 0x6f, 0xb0, 0xa5, 0x12, 0xcd, 0x65, 0xd0, 0x89,
0x39, 0x51, 0xc0, 0xba, 0xb7, 0x60, 0xc1, 0x3b, 0x24, 0x86, 0x6e, 0xef, 0x08, 0x19, 0x09, 0xd9,
0xa3, 0xa0, 0x69, 0xf8, 0xe0, 0x9c, 0x11, 0x62, 0xbc, 0x74, 0x6e, 0xb1, 0x45, 0xdb, 0xbc, 0xae,
0xdf, 0x0f, 0x64, 0x14, 0x73, 0x0c, 0xc1, 0x0d, 0x6f, 0x9e, 0xe4, 0xad, 0xee, 0x23, 0x94, 0xe2,
0x06, 0x0e, 0x01, 0xb2, 0xe8, 0xaf, 0x28, 0xc8, 0x39, 0x06, 0xe0, 0x86, 0xb7, 0x08, 0x1a, 0xdb,
0x6b, 0x20, 0x6f, 0xde, 0x62, 0x2b, 0xe5, 0xae, 0x88, 0x5b, 0x3e, 0xd7, 0xc2, 0xcf, 0x81, 0x5d,
0x71, 0x2d, 0x0c, 0x21, 0x83, 0x3f, 0x9b, 0x9c, 0xcd, 0x02, 0x72, 0x78, 0x0f, 0x9a, 0x84, 0x80,
0x98, 0x4b, 0x4b, 0xbf, 0x62, 0x2e, 0x7f, 0x19, 0xfa, 0x35, 0xce, 0x36, 0xce, 0x1e, 0x63, 0x1b,
0xcd, 0x1f, 0x99, 0x6c, 0x20, 0x88, 0x86, 0x38, 0x90, 0x30, 0xa7, 0x7c, 0x98, 0x42, 0x42, 0xfb,
0x96, 0x60, 0x63, 0xad, 0x38, 0x03, 0x76, 0x8d, 0xc4, 0xf9, 0xdb, 0x1a, 0x5b, 0x1e, 0xe7, 0xe5,
0xfe, 0xa1, 0x42, 0x27, 0x4e, 0x71, 0x69, 0x2d, 0x8d, 0xe5, 0x04, 0xdf, 0x55, 0x40, 0x13, 0x69,
0x4c, 0xfc, 0x9e, 0x4a, 0x07, 0x99, 0x2f, 0x07, 0x49, 0x87, 0x2b, 0x93, 0xa8, 0x2c, 0x91, 0xea,
0x33, 0xd0, 0xec, 0xa2, 0xa2, 0xf9, 0x8f, 0x1f, 0xb0, 0x99, 0x22, 0x3d, 0x72, 0xfe, 0xa2, 0xc6,
0x58, 0xb9, 0x91, 0x98, 0x9d, 0xe3, 0xe8, 0x84, 0x9b, 0x57, 0xee, 0x62, 0x1e, 0xb8, 0xb6, 0x47,
0xdb, 0xc7, 0xff, 0x9f, 0x21, 0xb8, 0xc2, 0x98, 0x4a, 0x07, 0xb0, 0x83, 0xc1, 0x86, 0x45, 0x93,
0x70, 0x06, 0x25, 0xb8, 0x5f, 0x35, 0x59, 0x43, 0x68, 0xea, 0xef, 0x61, 0x10, 0x8b, 0xc8, 0x6c,
0x38, 0xb3, 0x42, 0xef, 0x05, 0x79, 0xff, 0x39, 0x88, 0x9c, 0xd7, 0xd8, 0xbc, 0xc5, 0x60, 0xbd,
0x91, 0xd9, 0x6b, 0xe6, 0x08, 0xf4, 0x00, 0x65, 0x66, 0x5f, 0x42, 0x54, 0x5f, 0xe8, 0x3c, 0x55,
0x47, 0x7e, 0x9f, 0xc7, 0x76, 0x9b, 0x59, 0x22, 0xec, 0x23, 0xd2, 0x3c, 0xe2, 0x71, 0x04, 0xcb,
0x5c, 0x68, 0x5f, 0xc8, 0x9c, 0x2b, 0x19, 0xc4, 0x68, 0x69, 0xf6, 0x98, 0x79, 0xa1, 0x5b, 0x46,
0x0c, 0x46, 0x66, 0x53, 0xec, 0x70, 0x9d, 0x13, 0xaa, 0x6e, 0x97, 0xc4, 0x7d, 0xae, 0x73, 0x44,
0x5c, 0x66, 0x4c, 0x68, 0x3f, 0x20, 0x10, 0x6e, 0x2a, 0x75, 0xaf, 0x2e, 0xf4, 0x16, 0x22, 0x9c,
0x1b, 0x6c, 0x41, 0x68, 0x5f, 0x67, 0xfb, 0xaa, 0x80, 0x30, 0xdb, 0x82, 0x76, 0xb6, 0xaf, 0x0c,
0xec, 0x75, 0x84, 0x65, 0x81, 0xca, 0x45, 0x10, 0x13, 0x6c, 0x16, 0x61, 0x0d, 0x70, 0x1e, 0xa5,
0x88, 0xfb, 0x90, 0x5d, 0x80, 0xca, 0x7a, 0x3d, 0xc5, 0x7b, 0x41, 0x2e, 0x52, 0xe9, 0xeb, 0x41,
0x96, 0x41, 0x7f, 0xf3, 0x08, 0x29, 0x7d, 0xdd, 0x3b, 0x2f, 0xf4, 0x56, 0xa9, 0x6f, 0x17, 0x6a,
0x4c, 0x19, 0xb4, 0x2f, 0x92, 0x2c, 0x55, 0x39, 0xf5, 0xa6, 0xe4, 0x11, 0x12, 0xfb, 0xba, 0xb7,
0x28, 0x74, 0x0b, 0x15, 0x0f, 0x8c, 0x1c, 0xb6, 0xd6, 0x12, 0xad, 0x07, 0xc0, 0x6d, 0x72, 0x24,
0xf5, 0x75, 0x6f, 0xc1, 0x82, 0xdb, 0x24, 0x76, 0xde, 0x65, 0x6b, 0xb6, 0xff, 0x65, 0x0a, 0xa4,
0x7a, 0xc8, 0x55, 0x2e, 0xc0, 0xa5, 0x05, 0x34, 0x58, 0xa6, 0x11, 0xd8, 0x4d, 0xf3, 0xad, 0x42,
0xe5, 0x3c, 0x60, 0xeb, 0x93, 0x8d, 0xfc, 0x3c, 0xf5, 0x79, 0xa7, 0xe7, 0x67, 0xc4, 0xb3, 0xeb,
0xde, 0xc5, 0x09, 0xe6, 0xcf, 0xd2, 0x9d, 0x4e, 0x6f, 0x4f, 0x3b, 0x3b, 0x65, 0x29, 0x95, 0x12,
0xe2, 0x34, 0x0c, 0x62, 0xe8, 0xf0, 0x54, 0xc6, 0x47, 0x48, 0xc1, 0xeb, 0xde, 0x25, 0x2a, 0xa5,
0x2c, 0xe2, 0x31, 0x80, 0xb6, 0xf4, 0x53, 0x19, 0x1f, 0x39, 0x9f, 0xb0, 0xcb, 0xb6, 0x98, 0xae,
0x4a, 0x13, 0x9f, 0xe6, 0xad, 0xe2, 0xdd, 0x98, 0x87, 0x79, 0xaa, 0x90, 0x98, 0xd7, 0x3d, 0x97,
0x8a, 0x78, 0xa8, 0xd2, 0xc4, 0x03, 0x80, 0x67, 0xf5, 0xce, 0x3b, 0x6c, 0xd5, 0xda, 0x2b, 0x1e,
0x72, 0x31, 0xe4, 0x11, 0xd5, 0xbd, 0x6c, 0x23, 0x1d, 0x18, 0x7a, 0x46, 0x85, 0x55, 0x7e, 0xca,
0xae, 0x08, 0x5d, 0xa2, 0x8b, 0x8e, 0x48, 0xd2, 0x48, 0x74, 0x05, 0x8f, 0x90, 0xb9, 0xd7, 0xbd,
0x0b, 0x42, 0x5b, 0x33, 0xd3, 0x09, 0x4f, 0x0c, 0xc0, 0xf9, 0x26, 0x3b, 0x6f, 0x2b, 0xc5, 0x06,
0xc7, 0x47, 0x3e, 0x9d, 0x7b, 0x44, 0xc8, 0xa0, 0xeb, 0xde, 0x0a, 0x55, 0xfb, 0x98, 0x94, 0x6d,
0xd2, 0x1d, 0x33, 0x2b, 0xa6, 0x13, 0x47, 0x12, 0x3d, 0x6a, 0x66, 0xa7, 0x12, 0x3f, 0xd6, 0x45,
0xe6, 0xa4, 0xc6, 0x0f, 0xd3, 0x24, 0x09, 0x64, 0x84, 0x4c, 0x7a, 0xa4, 0x8b, 0x76, 0x09, 0xb0,
0x4d, 0x7a, 0xe7, 0x11, 0xbb, 0x3e, 0xda, 0xc5, 0x3c, 0x12, 0x3a, 0x57, 0xa2, 0x03, 0x3d, 0x6d,
0x0b, 0x71, 0xb1, 0x90, 0x2b, 0x95, 0x7e, 0xae, 0xa0, 0x6c, 0x49, 0xb4, 0x7a, 0xe9, 0x58, 0x07,
0xe7, 0x21, 0x8f, 0x90, 0x55, 0xe3, 0xea, 0x05, 0xc3, 0x96, 0x91, 0x1a, 0xfe, 0x61, 0x86, 0x25,
0x55, 0xa2, 0x27, 0x64, 0x00, 0xe8, 0x8b, 0xa3, 0xa3, 0x52, 0x6a, 0x9c, 0x6d, 0x76, 0x75, 0x92,
0x85, 0xaf, 0x73, 0x91, 0x87, 0x7d, 0x21, 0x7b, 0xee, 0xa5, 0xea, 0x6c, 0xaa, 0xda, 0xb6, 0x2d,
0xc4, 0xb9, 0x59, 0x3a, 0x08, 0xa1, 0x1e, 0x27, 0xc2, 0xe5, 0x72, 0x39, 0xe7, 0xfd, 0xe7, 0x99,
0xc4, 0x39, 0xf0, 0x80, 0x5d, 0x1b, 0xe9, 0x93, 0x30, 0x95, 0x5d, 0x1e, 0x71, 0x45, 0x4b, 0x3b,
0xe3, 0x5c, 0xb9, 0x57, 0xaa, 0xd5, 0x41, 0x8f, 0x6c, 0x57, 0x31, 0x7b, 0x9c, 0x2b, 0xe7, 0x5e,
0x39, 0xa0, 0xfa, 0x48, 0x86, 0x3c, 0xf2, 0x0f, 0x04, 0xf4, 0x4d, 0x2f, 0x73, 0xaf, 0x56, 0xd7,
0x5f, 0x1b, 0x95, 0x5f, 0x8a, 0xbc, 0xdf, 0xea, 0x65, 0x66, 0x81, 0xa3, 0x55, 0x32, 0x88, 0x73,
0x81, 0xdb, 0xdb, 0x35, 0xbb, 0xc0, 0x01, 0xff, 0xc4, 0x8a, 0xab, 0xd3, 0x5b, 0x24, 0x99, 0x1f,
0x06, 0x32, 0x12, 0xc8, 0x77, 0xd6, 0xab, 0x1d, 0xd9, 0x4a, 0xb2, 0x6d, 0xab, 0xa9, 0xee, 0xee,
0x44, 0x12, 0xaf, 0x57, 0x77, 0x77, 0xa2, 0x87, 0x9b, 0xcc, 0x2d, 0x67, 0x22, 0xf0, 0x32, 0x5c,
0x09, 0x04, 0x6f, 0x8e, 0x4e, 0x45, 0xd9, 0x7b, 0x0c, 0x4a, 0xb2, 0xab, 0x44, 0x85, 0x4e, 0x10,
0xee, 0x0f, 0x32, 0xf7, 0xd5, 0x6a, 0x54, 0xb8, 0x8f, 0x32, 0xe7, 0x61, 0xb9, 0x35, 0x10, 0xca,
0xcf, 0x54, 0x9a, 0xf3, 0x30, 0xaf, 0xb4, 0xf7, 0x35, 0xb4, 0xbb, 0x5c, 0xb5, 0xdb, 0x23, 0xd0,
0xc4, 0xc6, 0x63, 0x1c, 0xe0, 0x87, 0x14, 0x1f, 0xdc, 0x1b, 0xd5, 0xc6, 0xc3, 0xf6, 0xbc, 0x63,
0x34, 0xd5, 0x25, 0x16, 0x44, 0x91, 0x80, 0x91, 0xb2, 0x61, 0xe6, 0xf5, 0x6a, 0xbb, 0xb6, 0x0a,
0x25, 0x86, 0x92, 0x0f, 0x70, 0x77, 0xa7, 0x9d, 0x80, 0x1f, 0xe6, 0xfd, 0x34, 0xf3, 0x23, 0xa1,
0xc3, 0x40, 0x45, 0x3c, 0x72, 0x6f, 0xa2, 0xe1, 0x9a, 0xd9, 0x0b, 0x49, 0xfd, 0xc0, 0x6a, 0x9d,
0x3f, 0xad, 0xb1, 0x3a, 0xd8, 0xf8, 0xfd, 0x34, 0x73, 0x6f, 0x9d, 0x2e, 0x15, 0x98, 0x06, 0x47,
0x1e, 0xa5, 0x99, 0xf3, 0xe7, 0x35, 0x36, 0x23, 0xfb, 0x36, 0xe1, 0xb8, 0x8d, 0x5e, 0x1d, 0x9e,
0xb0, 0x57, 0x45, 0x02, 0xe5, 0xd5, 0x65, 0xdf, 0x64, 0x3a, 0xaf, 0xb1, 0x79, 0x48, 0x84, 0x54,
0x38, 0x8c, 0x4c, 0x2e, 0xf0, 0x06, 0xcd, 0x9f, 0x7e, 0xa0, 0xbd, 0x70, 0x18, 0x51, 0x2e, 0x00,
0xf4, 0xa5, 0x44, 0xbc, 0x89, 0xc4, 0x71, 0x46, 0x15, 0xea, 0xb7, 0xd9, 0x32, 0x14, 0x42, 0x5b,
0xa8, 0xe4, 0xb9, 0xc1, 0xbd, 0x45, 0xf1, 0xb4, 0x1f, 0x68, 0xdc, 0x3f, 0x77, 0x79, 0x4e, 0xf0,
0x6b, 0x6c, 0x96, 0xa0, 0x04, 0x7b, 0x1b, 0x8b, 0x63, 0x28, 0x2a, 0xaa, 0x13, 0xbd, 0xcc, 0x4f,
0x78, 0xae, 0x44, 0xe8, 0xde, 0xa1, 0xea, 0x44, 0x2f, 0x7b, 0x82, 0x02, 0xb0, 0xc7, 0x89, 0x71,
0x00, 0x34, 0x2b, 0x77, 0xef, 0x92, 0x3d, 0x88, 0xbe, 0x44, 0x09, 0x84, 0xf7, 0x82, 0x16, 0x62,
0xf8, 0x52, 0xbe, 0x88, 0xdc, 0x6f, 0xd0, 0x89, 0x92, 0xd5, 0x60, 0xd8, 0x52, 0xad, 0xc8, 0x79,
0x93, 0x39, 0xe0, 0x7d, 0x12, 0xe5, 0x86, 0x1f, 0xc3, 0xe8, 0xb9, 0xef, 0xd0, 0xf2, 0xef, 0x07,
0xfa, 0x49, 0x94, 0x23, 0x3b, 0x06, 0x36, 0xe7, 0xfc, 0xac, 0xc6, 0xe6, 0xc7, 0x90, 0x1b, 0xa7,
0x3b, 0xc5, 0xe6, 0x92, 0xaa, 0x7f, 0x57, 0x18, 0xa3, 0xcc, 0x4a, 0x8b, 0x1f, 0x70, 0xf7, 0x5d,
0xea, 0x3a, 0x94, 0xb4, 0xc5, 0x0f, 0xf0, 0xfa, 0x02, 0xda, 0x0a, 0x89, 0xd6, 0x3d, 0x6c, 0xe0,
0x54, 0x3f, 0xd0, 0x3b, 0x5a, 0x38, 0x7f, 0x53, 0x63, 0xf3, 0xa3, 0x29, 0x99, 0xfb, 0x4d, 0x6c,
0xd7, 0x1f, 0x9c, 0xca, 0x69, 0x59, 0x99, 0x17, 0x9a, 0x4b, 0x83, 0x1d, 0xf8, 0xa7, 0x85, 0x73,
0x95, 0xcd, 0x42, 0x03, 0x7a, 0x74, 0x96, 0xe6, 0x6e, 0x16, 0x99, 0xfb, 0x67, 0x78, 0x96, 0xe6,
0xfc, 0xb8, 0xc6, 0xa6, 0xad, 0xf2, 0x3d, 0x6c, 0xc0, 0xf0, 0x84, 0x1b, 0x60, 0xd2, 0x55, 0x6f,
0xaa, 0x47, 0x1e, 0x19, 0x8f, 0x65, 0x9f, 0x9c, 0x7a, 0xbf, 0xf0, 0x78, 0xb7, 0x5f, 0x78, 0x6c,
0x95, 0x1f, 0x9c, 0xae, 0xc7, 0x92, 0x3c, 0xba, 0xc5, 0x60, 0xcd, 0xfa, 0x9a, 0x87, 0xa9, 0xb4,
0x6b, 0xfe, 0x43, 0x22, 0x15, 0xfd, 0x40, 0xb7, 0x51, 0x4c, 0x0b, 0xf5, 0x3a, 0x9b, 0x1b, 0x41,
0x7d, 0x84, 0xf3, 0x6d, 0x56, 0x57, 0x20, 0x1f, 0xb1, 0x8b, 0x34, 0xa4, 0xa1, 0x50, 0xe1, 0x40,
0xe4, 0x10, 0xd3, 0xf2, 0x81, 0x86, 0x3c, 0x67, 0xc0, 0xdd, 0x8f, 0x31, 0xdb, 0x3f, 0x8f, 0x88,
0x6d, 0x02, 0xb4, 0x51, 0xff, 0x1c, 0xd4, 0x90, 0x0b, 0x10, 0x23, 0x88, 0x83, 0xcc, 0x0f, 0xd3,
0x81, 0xcc, 0xdd, 0x6f, 0x61, 0x15, 0x0d, 0x10, 0x3f, 0x8c, 0x83, 0x6c, 0x1b, 0x84, 0xce, 0x7b,
0xcc, 0xa5, 0x3a, 0xb5, 0xaf, 0x05, 0xf4, 0x42, 0x57, 0x28, 0x9d, 0xa3, 0x99, 0xfb, 0x09, 0x1a,
0xac, 0x1a, 0x7d, 0x1b, 0xd4, 0x0f, 0x41, 0x0b, 0xd6, 0x78, 0xc6, 0x22, 0x12, 0x0e, 0x3c, 0x7b,
0x20, 0x6d, 0xfe, 0xe0, 0x7e, 0x9b, 0x8e, 0x2e, 0x40, 0xf3, 0x2c, 0xfd, 0xa2, 0x90, 0x3b, 0x37,
0xd8, 0x3c, 0xf5, 0x9c, 0x9f, 0x71, 0x19, 0xc4, 0xf9, 0x91, 0xfb, 0x29, 0x79, 0x43, 0xd2, 0x3d,
0x12, 0x3a, 0xaf, 0xb2, 0x46, 0x3f, 0x88, 0xbb, 0xb1, 0xe8, 0x72, 0x1f, 0xca, 0x70, 0xb7, 0xe8,
0x78, 0xc5, 0x0a, 0x9f, 0x89, 0x84, 0x3b, 0xb7, 0xd9, 0xa2, 0x2d, 0xb7, 0x28, 0xed, 0x3e, 0xe2,
0x16, 0xac, 0xdc, 0x96, 0x77, 0x8d, 0xcd, 0xe2, 0x6d, 0xa2, 0xe9, 0xb3, 0x6d, 0xda, 0xef, 0x50,
0x44, 0xdd, 0xb4, 0xc1, 0x56, 0x93, 0xe0, 0x50, 0x24, 0x83, 0xa4, 0xc8, 0x81, 0xa8, 0xe2, 0x07,
0x08, 0x5d, 0x36, 0x4a, 0x9b, 0x00, 0x61, 0xfd, 0x77, 0xd9, 0x4a, 0x91, 0xca, 0x01, 0xe7, 0xcc,
0x60, 0x60, 0x7a, 0xdc, 0xdd, 0xa1, 0xcb, 0xa3, 0x8e, 0xc9, 0xe9, 0xb6, 0xd3, 0x24, 0x6b, 0x83,
0xc2, 0xf9, 0xfb, 0x1a, 0x5b, 0x1d, 0xb3, 0x38, 0x10, 0x52, 0x72, 0xe5, 0x3e, 0x3c, 0xdd, 0x0d,
0xd0, 0xa9, 0xfa, 0xfa, 0x25, 0xba, 0x04, 0x74, 0xaa, 0xf4, 0x55, 0x44, 0x23, 0xee, 0x7e, 0x86,
0x9d, 0xb2, 0x62, 0xad, 0x5a, 0x51, 0xc5, 0xee, 0x0a, 0x63, 0x76, 0xc2, 0xf5, 0xb4, 0xfb, 0x68,
0xbd, 0x76, 0xeb, 0x9c, 0x37, 0x63, 0xe6, 0x5a, 0x4f, 0x03, 0x51, 0xac, 0x70, 0x6d, 0x83, 0x6a,
0xd1, 0xa8, 0x65, 0x05, 0xdb, 0x26, 0xec, 0x3a, 0x9b, 0xab, 0xba, 0xe0, 0x7e, 0x87, 0x86, 0xad,
0xac, 0x16, 0xaf, 0x32, 0x30, 0x0e, 0x5a, 0xc8, 0xe7, 0xb4, 0x7c, 0x50, 0x68, 0x30, 0xeb, 0x6c,
0x0e, 0x23, 0xaf, 0x85, 0x3c, 0x36, 0x83, 0x1f, 0x0e, 0x23, 0x83, 0x78, 0x8b, 0x39, 0xa8, 0xcc,
0x83, 0x4e, 0xcc, 0x7d, 0x7b, 0xdb, 0xfc, 0x84, 0xa6, 0x30, 0x68, 0x9e, 0x81, 0xe2, 0xb9, 0xb9,
0x76, 0xfe, 0xb7, 0x1a, 0xbb, 0x60, 0x2a, 0xe5, 0x5c, 0xe9, 0xd1, 0x5c, 0xd3, 0xdd, 0x5d, 0x3f,
0x7b, 0x6b, 0x76, 0xe3, 0xf7, 0x4e, 0x7c, 0x24, 0x2b, 0x07, 0x6f, 0xde, 0x1a, 0x35, 0x1f, 0xbc,
0xab, 0xe6, 0xb8, 0xce, 0x2f, 0x6a, 0x6c, 0x2d, 0xe3, 0x13, 0xdd, 0x7e, 0xfa, 0x12, 0xb8, 0xbd,
0x9c, 0xf1, 0xc9, 0x3e, 0x97, 0x93, 0x20, 0x55, 0xca, 0xef, 0x88, 0xbc, 0x2b, 0x78, 0x1c, 0xb9,
0x7b, 0x2f, 0x83, 0xcf, 0x76, 0x32, 0x3e, 0x55, 0xea, 0xbe, 0x71, 0xcc, 0xf9, 0xba, 0xc6, 0x56,
0x83, 0x28, 0x9a, 0xe0, 0xf2, 0xaf, 0xbd, 0x04, 0x2e, 0x3b, 0x41, 0x14, 0x8d, 0x7b, 0x7c, 0x93,
0x2d, 0x94, 0xf3, 0x21, 0x4f, 0xfd, 0x8c, 0xbb, 0x1e, 0x85, 0xab, 0xaa, 0x78, 0x0f, 0x4f, 0xfd,
0x95, 0xe8, 0xf8, 0xdd, 0x40, 0xc4, 0x3c, 0x72, 0xdb, 0x14, 0x89, 0x95, 0xe8, 0x3c, 0x44, 0x81,
0xf3, 0x21, 0xbb, 0xa8, 0xa5, 0xaf, 0xb2, 0x7d, 0xe1, 0x53, 0x2a, 0xeb, 0x07, 0x9a, 0xce, 0xe3,
0x44, 0x7e, 0xe4, 0x3e, 0xc3, 0x15, 0xb5, 0xa6, 0xa5, 0x97, 0xed, 0x8b, 0xa7, 0xa8, 0xdf, 0xd2,
0xcf, 0x8d, 0xd6, 0xf9, 0x84, 0x5d, 0xd6, 0xfd, 0xf4, 0xe0, 0x85, 0xd6, 0x5f, 0xd0, 0x91, 0x00,
0x60, 0x26, 0xda, 0xdf, 0x63, 0x6b, 0x02, 0x5a, 0xab, 0x45, 0x4f, 0x06, 0x31, 0x8f, 0x4a, 0xcb,
0xe7, 0x26, 0x4b, 0xea, 0xf4, 0xb2, 0xb6, 0x51, 0x16, 0x56, 0xdf, 0x61, 0xcd, 0x49, 0x15, 0x52,
0xce, 0x1c, 0x09, 0x4d, 0xb7, 0x00, 0x5f, 0x62, 0x09, 0x57, 0xd5, 0x78, 0xbd, 0x08, 0x7b, 0x60,
0x50, 0x10, 0x6b, 0x83, 0x30, 0xe4, 0x59, 0xee, 0xa7, 0x07, 0x92, 0x12, 0xb4, 0xef, 0x52, 0xa2,
0x4e, 0xe2, 0xa7, 0x07, 0x12, 0x33, 0xb3, 0x1d, 0xb6, 0x5e, 0xc1, 0x69, 0x1e, 0x77, 0xfd, 0xca,
0xe1, 0x40, 0xe6, 0x83, 0xe1, 0xf7, 0x28, 0x53, 0x2f, 0x0c, 0xdb, 0x3c, 0xee, 0x3e, 0x2d, 0x40,
0x7b, 0x5b, 0x79, 0x1f, 0x82, 0x5a, 0x50, 0x21, 0xf9, 0xbf, 0x8e, 0x5b, 0x2d, 0x0b, 0x4a, 0x96,
0xdf, 0x64, 0x0d, 0xbc, 0x3d, 0xd6, 0x5d, 0xca, 0x03, 0xdd, 0xdf, 0xa0, 0xac, 0x19, 0x84, 0xed,
0x2e, 0xa6, 0x7e, 0xb0, 0xf7, 0x75, 0xf1, 0x26, 0x52, 0x48, 0x6c, 0x38, 0x01, 0x7f, 0x93, 0xf2,
0x0e, 0xd4, 0xb4, 0x48, 0x81, 0xe8, 0xdb, 0x6c, 0x09, 0x89, 0x3e, 0x94, 0x2a, 0x3b, 0x74, 0x62,
0xec, 0xfe, 0x56, 0x41, 0x6c, 0x9e, 0x0c, 0x33, 0xb9, 0xdb, 0xc1, 0x43, 0x5b, 0xe7, 0xa7, 0x35,
0x53, 0x7b, 0x81, 0xfb, 0xed, 0xd3, 0x0d, 0x72, 0xd8, 0x6c, 0xeb, 0xdd, 0x3b, 0x6c, 0xb5, 0x6c,
0x88, 0xc9, 0x8e, 0xd1, 0x49, 0x9f, 0xd2, 0x70, 0xdb, 0x18, 0x52, 0xa1, 0xc9, 0x5f, 0xd7, 0xd8,
0xd2, 0x71, 0xfc, 0xf7, 0x4f, 0xb7, 0x51, 0x0b, 0xc9, 0x98, 0x97, 0x4d, 0x60, 0x4e, 0xa6, 0x61,
0x59, 0xa2, 0x85, 0x1b, 0xd0, 0x98, 0x9b, 0x06, 0xed, 0x25, 0x5a, 0x40, 0xc6, 0x5a, 0xe8, 0xe9,
0x38, 0xbd, 0x43, 0xf4, 0x2a, 0x31, 0x08, 0x3c, 0x51, 0x7f, 0x9d, 0x2d, 0x94, 0x28, 0x8a, 0xd3,
0x21, 0x71, 0x35, 0x0b, 0xa3, 0x28, 0x3d, 0x82, 0x23, 0x12, 0x1b, 0x8d, 0xe2, 0x88, 0xc6, 0x8e,
0xe0, 0x88, 0x87, 0x71, 0xe4, 0xae, 0x05, 0x8e, 0xa8, 0x98, 0xe1, 0xce, 0x88, 0xe5, 0x87, 0x79,
0x98, 0x26, 0x89, 0xdb, 0x1d, 0x99, 0x62, 0x3b, 0x24, 0x75, 0xde, 0x66, 0x0e, 0x3f, 0xcc, 0xb9,
0x8c, 0x38, 0xd2, 0x93, 0x64, 0x20, 0x61, 0xb5, 0xf7, 0xb0, 0xd0, 0x25, 0xab, 0xd9, 0xb6, 0x8a,
0xd2, 0x81, 0x92, 0x9e, 0xf4, 0x2b, 0x8e, 0x16, 0x14, 0xe5, 0x02, 0xab, 0x9b, 0x3c, 0xbc, 0xef,
0x0a, 0xac, 0x78, 0x1a, 0xbf, 0x77, 0xfb, 0x40, 0xf9, 0x54, 0xee, 0x6b, 0xc8, 0xcf, 0x45, 0x22,
0xf2, 0xe2, 0x96, 0xf0, 0x77, 0xe8, 0x6e, 0x40, 0xe5, 0x6d, 0x9e, 0x3f, 0x06, 0x4d, 0x79, 0x4f,
0x38, 0x4f, 0xc7, 0x7f, 0x64, 0x25, 0x22, 0x77, 0x9f, 0x18, 0x0a, 0x48, 0x3d, 0x80, 0xb7, 0x22,
0xe7, 0x1e, 0x3b, 0x5f, 0x05, 0xd1, 0x71, 0x31, 0x71, 0xf5, 0x98, 0xe8, 0x67, 0x81, 0xc6, 0x94,
0x9b, 0x18, 0xfb, 0xc7, 0xec, 0x52, 0x71, 0x2c, 0xd4, 0xf5, 0x71, 0x36, 0xc5, 0xb1, 0xcf, 0x63,
0xd1, 0x13, 0x9d, 0x98, 0xbb, 0x89, 0x3d, 0xbf, 0xc7, 0xa3, 0xa1, 0x6e, 0x8b, 0xf4, 0x3b, 0x46,
0x6d, 0x0f, 0xec, 0xb8, 0x4a, 0x02, 0xc9, 0xa5, 0xb9, 0x8f, 0x90, 0xc5, 0x81, 0x9d, 0x95, 0xe3,
0xaa, 0x7f, 0x93, 0x2d, 0xf5, 0x54, 0x10, 0xf2, 0xee, 0x20, 0xf6, 0x75, 0x7f, 0x90, 0x47, 0xe9,
0x81, 0x74, 0x53, 0xda, 0x22, 0xac, 0xa2, 0x6d, 0xe4, 0xce, 0x07, 0xec, 0x02, 0x4e, 0x02, 0x1e,
0xf9, 0x03, 0x29, 0xf0, 0xd9, 0x8f, 0x0e, 0xba, 0x82, 0x2a, 0xc8, 0xe8, 0xd8, 0xc9, 0x00, 0xbe,
0x20, 0x7d, 0x3b, 0xe8, 0x0a, 0xac, 0xe7, 0x35, 0x36, 0x3f, 0x36, 0x3e, 0x5f, 0xd1, 0xbc, 0x1c,
0x19, 0x9e, 0xbb, 0x6c, 0x05, 0xe6, 0xc7, 0xb1, 0x95, 0xa8, 0x68, 0x0c, 0xfa, 0x81, 0x7e, 0x3e,
0xba, 0x24, 0x7e, 0x5e, 0x63, 0x8b, 0xc7, 0xd0, 0xfa, 0x74, 0xd7, 0xed, 0xfc, 0xd8, 0xb2, 0xdd,
0xc0, 0x4b, 0x0f, 0x88, 0x02, 0xbe, 0x56, 0xa1, 0xaf, 0x22, 0x1f, 0xf2, 0x0c, 0x2e, 0x73, 0x37,
0xb7, 0xe7, 0x82, 0xb0, 0xfb, 0xb7, 0x55, 0xe8, 0x45, 0x7b, 0xa4, 0xa9, 0x3e, 0xa4, 0x1c, 0x8c,
0x3c, 0xa4, 0xbc, 0xcb, 0x96, 0x69, 0x0e, 0x45, 0x42, 0xe7, 0x42, 0xf6, 0x06, 0x42, 0xf7, 0xb9,
0x72, 0x87, 0x08, 0x72, 0x50, 0xf5, 0xa0, 0xaa, 0x69, 0x7e, 0x4e, 0x17, 0xca, 0x19, 0x1e, 0x8f,
0xc7, 0x9d, 0xd8, 0xe7, 0x32, 0x57, 0x47, 0x3e, 0x72, 0x79, 0x5e, 0x79, 0xe8, 0x87, 0x77, 0x6e,
0x19, 0xb7, 0x37, 0xc3, 0x2b, 0xec, 0x15, 0x5a, 0xef, 0xf4, 0xe6, 0x80, 0x3e, 0x9a, 0xdf, 0xa7,
0xbb, 0x60, 0x7b, 0x3d, 0xae, 0x45, 0xe4, 0xe7, 0x8e, 0xc3, 0xce, 0x55, 0x1e, 0x1a, 0xe0, 0xdf,
0x93, 0xcd, 0x7f, 0x99, 0xeb, 0xe6, 0x23, 0x36, 0xad, 0x15, 0x16, 0xfc, 0x2b, 0x97, 0x7b, 0x6f,
0x42, 0xb9, 0x2f, 0xbc, 0xe9, 0x3e, 0x77, 0xbc, 0xea, 0x7f, 0xa9, 0xb1, 0x59, 0xad, 0x7c, 0x7e,
0x98, 0xd1, 0xd5, 0xee, 0x1a, 0x9b, 0x32, 0x67, 0x68, 0x35, 0x7a, 0x10, 0x4a, 0x5f, 0xce, 0x0f,
0x6b, 0x6c, 0x5a, 0xf3, 0x5e, 0x02, 0x23, 0x78, 0x06, 0x49, 0x9f, 0x3a, 0xc1, 0xa9, 0x66, 0x7a,
0xc7, 0xb3, 0x2e, 0x34, 0xff, 0xe4, 0x15, 0xb6, 0x8c, 0xdc, 0xc8, 0xbe, 0x7b, 0x31, 0x03, 0x5c,
0x3e, 0x79, 0xe0, 0x32, 0x0c, 0xb2, 0xf2, 0x31, 0x48, 0xc3, 0x3e, 0x79, 0xd8, 0x01, 0x39, 0xc6,
0x83, 0x9f, 0xd5, 0xd8, 0x6c, 0x65, 0x50, 0xcd, 0x15, 0xf1, 0x49, 0x73, 0xd9, 0x91, 0x69, 0xe5,
0x31, 0xf3, 0xd9, 0x16, 0x91, 0xf3, 0x4f, 0xc0, 0xba, 0x63, 0xd8, 0xa9, 0x81, 0x45, 0x55, 0x3d,
0x3d, 0xfb, 0x12, 0x78, 0xba, 0x5c, 0xb8, 0x76, 0xbf, 0x74, 0xf9, 0x2a, 0x63, 0x99, 0xe2, 0x5d,
0xae, 0xb8, 0x0c, 0xb9, 0x79, 0xde, 0x5c, 0x91, 0xc0, 0x4c, 0xd6, 0x79, 0x90, 0xdb, 0x37, 0x31,
0xf4, 0xe1, 0xbc, 0xca, 0x1a, 0x8a, 0x7f, 0x35, 0x80, 0xa4, 0x88, 0xb4, 0xf4, 0x02, 0x75, 0xce,
0x08, 0xdb, 0x08, 0xfa, 0x49, 0x8d, 0xcd, 0x99, 0xd1, 0xf7, 0x63, 0xa1, 0x73, 0x77, 0x1a, 0x67,
0xe1, 0xf0, 0x64, 0x67, 0xa1, 0x5d, 0x27, 0xde, 0xac, 0xf1, 0xe5, 0xb1, 0xd0, 0x79, 0xf3, 0x9f,
0x6b, 0x34, 0x1b, 0xf3, 0x81, 0xa4, 0x69, 0x67, 0x66, 0xe3, 0x4f, 0x6b, 0x6c, 0xa6, 0x78, 0x27,
0x66, 0x9e, 0x49, 0xfc, 0xfe, 0x09, 0x8f, 0xda, 0xd8, 0x0a, 0xf1, 0xea, 0xf6, 0x55, 0x58, 0xf3,
0x2f, 0x17, 0xd9, 0x1a, 0x20, 0x80, 0x69, 0xa4, 0xd2, 0x0f, 0xf2, 0x5c, 0x55, 0x96, 0x91, 0xd0,
0x86, 0x87, 0x17, 0x1b, 0x77, 0xcd, 0x06, 0x53, 0x62, 0xe3, 0x76, 0xd7, 0xa6, 0x0b, 0x20, 0x73,
0x80, 0xa0, 0x78, 0xb7, 0xc0, 0x9f, 0xb1, 0x1b, 0x3d, 0x1e, 0xf5, 0xef, 0x29, 0xde, 0xb5, 0x26,
0xdf, 0xc2, 0x48, 0x1f, 0xe4, 0x69, 0x22, 0xc2, 0xf2, 0x7e, 0xb5, 0x30, 0x3c, 0x6b, 0xef, 0x4a,
0xb7, 0x10, 0x51, 0x5c, 0xb2, 0x5a, 0xf3, 0x0d, 0xac, 0xd1, 0xda, 0xa5, 0xaa, 0x30, 0x3c, 0x67,
0xef, 0xf3, 0xb6, 0x0a, 0x9d, 0xb5, 0xa1, 0x16, 0x99, 0xa4, 0xc8, 0xe2, 0x5f, 0xb1, 0x2d, 0xa2,
0x44, 0xc4, 0x62, 0xdf, 0xc4, 0xa7, 0x00, 0x81, 0xe1, 0x22, 0x16, 0x3c, 0x65, 0xc1, 0x5b, 0xc8,
0x40, 0x2c, 0x98, 0x2e, 0x51, 0x0b, 0xb6, 0x56, 0xc0, 0xa7, 0x6d, 0xeb, 0x0b, 0xbe, 0x66, 0x2d,
0xb6, 0xf0, 0x6a, 0xfb, 0x38, 0xd1, 0x2b, 0x4c, 0xeb, 0xf6, 0x5e, 0x7f, 0x67, 0x9c, 0xf2, 0xd9,
0x22, 0xe8, 0x8a, 0x4f, 0xeb, 0xa0, 0xb0, 0x99, 0x29, 0x9e, 0x4d, 0xe8, 0x60, 0xdc, 0x35, 0x29,
0xf1, 0x1a, 0xbe, 0xc0, 0xb2, 0xd2, 0x35, 0xa3, 0xb2, 0x16, 0xe6, 0xa1, 0x05, 0x10, 0x5a, 0x0b,
0x2e, 0x1f, 0x5a, 0x24, 0x5a, 0x58, 0x9c, 0xb9, 0x63, 0xce, 0xb2, 0x24, 0x2b, 0x80, 0x73, 0xc5,
0x1d, 0x33, 0x88, 0x47, 0x4b, 0xc4, 0xb4, 0xce, 0x02, 0x1b, 0xb6, 0xc4, 0x2d, 0xd1, 0x2b, 0x70,
0xe6, 0xfe, 0x7b, 0x2c, 0xc4, 0x9b, 0x07, 0xdc, 0xd6, 0x72, 0xbe, 0xb8, 0xff, 0x1e, 0x8d, 0xf7,
0xc8, 0xc7, 0x6d, 0x49, 0x74, 0xbb, 0x18, 0x6b, 0x9c, 0xd0, 0x74, 0x7f, 0x6e, 0xed, 0x17, 0xec,
0xed, 0xe2, 0x63, 0xbd, 0x65, 0x95, 0xd6, 0x8c, 0x5e, 0x69, 0x50, 0x7d, 0x42, 0x46, 0xfc, 0xb0,
0xb0, 0x5a, 0xb4, 0xb3, 0x0a, 0xab, 0x69, 0x81, 0xce, 0x1a, 0x5d, 0x63, 0xb3, 0xe5, 0x63, 0x23,
0x7a, 0xcd, 0xdc, 0xf0, 0x58, 0xf1, 0xd6, 0x47, 0xc3, 0xd6, 0x56, 0x99, 0xa7, 0x01, 0xbd, 0x61,
0x6e, 0x78, 0x73, 0xa5, 0x70, 0x4b, 0x03, 0xed, 0xaf, 0x82, 0x46, 0x1e, 0x31, 0x2f, 0x55, 0x90,
0x26, 0xaa, 0xaf, 0xb1, 0x29, 0x93, 0x21, 0xaf, 0x50, 0x88, 0xa6, 0x2f, 0xe7, 0x36, 0x5b, 0x2c,
0x57, 0xa1, 0xd9, 0x82, 0x57, 0x29, 0xf4, 0xc5, 0x76, 0x05, 0x9a, 0x7d, 0x78, 0x8d, 0x4d, 0xd1,
0x52, 0xc0, 0x37, 0x0d, 0x0d, 0xcf, 0x7c, 0x21, 0x03, 0x33, 0xa9, 0xf5, 0x79, 0xc3, 0xc0, 0xb4,
0x79, 0xc6, 0x33, 0x53, 0x26, 0x24, 0x2e, 0x26, 0x24, 0xa5, 0xc0, 0x79, 0x9f, 0xb9, 0x13, 0xa6,
0x33, 0x31, 0xde, 0x0b, 0x74, 0x46, 0x72, 0x2c, 0x7b, 0x21, 0xee, 0x3b, 0x39, 0xe3, 0xb9, 0xf8,
0xa2, 0x8c, 0xe7, 0x4d, 0xb6, 0x34, 0x90, 0xfb, 0x32, 0x3d, 0x90, 0xe5, 0xe8, 0xba, 0x97, 0x10,
0xbd, 0x68, 0x14, 0xc5, 0xc0, 0x3a, 0x2e, 0x9b, 0x0e, 0xe3, 0x81, 0xce, 0xb9, 0x72, 0x2f, 0x23,
0xc4, 0x7e, 0x42, 0x98, 0xb2, 0xe7, 0x13, 0x29, 0xbd, 0x21, 0x98, 0xf1, 0x2a, 0x12, 0xd8, 0x2c,
0xe2, 0x8d, 0x3c, 0x1b, 0xbe, 0xeb, 0x6b, 0xae, 0xb5, 0x48, 0x25, 0xe4, 0x39, 0x57, 0x4d, 0x57,
0xa2, 0xa2, 0x4d, 0xf2, 0x56, 0x44, 0xbf, 0x6b, 0x41, 0x6c, 0x98, 0xa6, 0xfb, 0x82, 0xbb, 0xd7,
0xec, 0xef, 0x5a, 0x40, 0xb8, 0x8d, 0x32, 0xe7, 0x06, 0x9b, 0x2f, 0x97, 0x21, 0x72, 0x92, 0x75,
0x4a, 0xd4, 0x0a, 0x29, 0x32, 0x92, 0x9b, 0x6c, 0xa1, 0x84, 0x51, 0x46, 0x79, 0x1d, 0x4b, 0x2b,
0xad, 0x29, 0xa5, 0x7c, 0x83, 0x2d, 0x55, 0x4e, 0x4a, 0x0c, 0xb4, 0x89, 0xe7, 0x25, 0x0b, 0xe5,
0x79, 0x09, 0x61, 0x2f, 0xb1, 0x99, 0x32, 0x2f, 0x7e, 0x15, 0xab, 0xad, 0x67, 0x36, 0x27, 0x06,
0x42, 0x5c, 0xa6, 0xc3, 0xaf, 0xd1, 0xdd, 0x60, 0x56, 0xa4, 0xc2, 0x56, 0x4d, 0xf4, 0xf3, 0x46,
0xa9, 0x2e, 0x2e, 0x65, 0x2b, 0xc9, 0xef, 0xeb, 0x34, 0x2d, 0xb2, 0x22, 0xf1, 0x05, 0x75, 0x96,
0xf8, 0x19, 0xa9, 0x6f, 0x1a, 0xeb, 0x2c, 0xd9, 0x43, 0x81, 0xf3, 0xaf, 0x74, 0x7a, 0x3b, 0x61,
0xc1, 0xbb, 0xb7, 0x30, 0xb6, 0x9f, 0xf4, 0x3d, 0xe3, 0x78, 0xba, 0xe0, 0xad, 0x64, 0x13, 0xf6,
0x19, 0x58, 0x24, 0x66, 0x77, 0x71, 0x6f, 0x63, 0x93, 0xa7, 0x62, 0xdc, 0x4e, 0x60, 0x57, 0xac,
0xee, 0x1f, 0x88, 0x78, 0x83, 0xc6, 0x2f, 0x2e, 0xb6, 0x0e, 0x44, 0xfe, 0xbc, 0xc6, 0xe6, 0xaa,
0x3c, 0x15, 0xef, 0xcf, 0x4f, 0x9e, 0x1b, 0x8c, 0xf1, 0x15, 0x6f, 0xb6, 0x42, 0x91, 0x9b, 0x3f,
0x32, 0xa4, 0x06, 0x79, 0x81, 0x32, 0xd7, 0x91, 0xff, 0x77, 0x6f, 0x6e, 0x61, 0x2f, 0x4d, 0x82,
0x70, 0x2c, 0x57, 0x61, 0x49, 0x60, 0x7f, 0x34, 0xd0, 0xfc, 0x87, 0x06, 0xbd, 0x41, 0x45, 0x87,
0xcc, 0x2b, 0x22, 0xb3, 0x5b, 0x6d, 0xf8, 0x9d, 0xa3, 0x9c, 0x1b, 0x86, 0xd2, 0xb0, 0x21, 0x7a,
0xe3, 0xfe, 0x51, 0xce, 0xcd, 0x9b, 0xa5, 0x20, 0xcb, 0x62, 0x11, 0xd2, 0x29, 0x28, 0x70, 0x89,
0x83, 0xe0, 0x68, 0x8c, 0xa8, 0x5c, 0x12, 0x7a, 0xab, 0x04, 0x7d, 0x46, 0x18, 0xbb, 0xd1, 0xbf,
0xcd, 0x96, 0x05, 0x8d, 0x39, 0x9e, 0x68, 0x8c, 0x32, 0x95, 0x45, 0x81, 0xe3, 0xdf, 0xe6, 0xb9,
0x85, 0xdf, 0x65, 0x2b, 0x00, 0xc3, 0x35, 0x2a, 0x64, 0x27, 0x1d, 0xc8, 0x08, 0x1f, 0x1c, 0x11,
0x41, 0x59, 0xd2, 0x3c, 0x87, 0xd8, 0xd7, 0x22, 0x4d, 0xab, 0x97, 0x41, 0xd0, 0x3a, 0x66, 0x60,
0x36, 0x79, 0x22, 0x29, 0x2b, 0xa3, 0x36, 0xe6, 0x40, 0x94, 0x78, 0x00, 0x0c, 0xce, 0x28, 0x4b,
0x99, 0x13, 0xda, 0x93, 0xfd, 0x51, 0xee, 0xa3, 0x44, 0xa7, 0x0a, 0x9c, 0xb6, 0x74, 0xc6, 0x43,
0x79, 0x85, 0x33, 0x94, 0x71, 0x73, 0x9f, 0x1f, 0xd9, 0x97, 0xc1, 0x75, 0x5c, 0xbd, 0x4e, 0xa1,
0xfb, 0x9c, 0x1f, 0xd1, 0xd3, 0x60, 0xe7, 0x03, 0x76, 0xa1, 0xb4, 0xa0, 0x4b, 0x49, 0xbc, 0x5d,
0x93, 0x5d, 0xd1, 0x33, 0xb4, 0x64, 0xad, 0x00, 0x78, 0xa0, 0x6f, 0x45, 0xdb, 0xa8, 0x75, 0xde,
0x9f, 0x68, 0x9a, 0x04, 0x87, 0xb0, 0xdf, 0xd2, 0xc3, 0xf2, 0xd5, 0x71, 0xd3, 0x27, 0xc1, 0x61,
0x0b, 0x5f, 0xe9, 0x4d, 0xb0, 0x94, 0x69, 0x64, 0x1f, 0x99, 0xaf, 0x8c, 0xdb, 0xed, 0xa6, 0x11,
0x77, 0x3e, 0x62, 0x17, 0x27, 0xf9, 0x3a, 0x50, 0xca, 0x32, 0x98, 0x86, 0x77, 0xfe, 0x98, 0xb3,
0xa4, 0x7e, 0x41, 0x9d, 0xfb, 0xfc, 0x88, 0x7e, 0xff, 0x35, 0xa1, 0xce, 0xcf, 0xf9, 0x91, 0x76,
0xee, 0xb3, 0xab, 0x13, 0xcc, 0x14, 0x0f, 0xd3, 0x21, 0x87, 0xd9, 0x14, 0x22, 0xad, 0x69, 0x78,
0x17, 0xc7, 0xad, 0x3d, 0x82, 0xb4, 0x79, 0x08, 0x71, 0x6f, 0x98, 0xc9, 0xb1, 0xe3, 0x8f, 0x05,
0xba, 0xcf, 0x1b, 0x66, 0x72, 0x64, 0x93, 0x72, 0xbe, 0xae, 0xb1, 0xa5, 0x0a, 0xa7, 0xc7, 0x22,
0xe9, 0xb1, 0xe8, 0xec, 0xc6, 0x1f, 0x9d, 0xf4, 0xaf, 0x53, 0x8e, 0x27, 0x17, 0xde, 0x22, 0xc9,
0x8a, 0x40, 0xad, 0x21, 0x13, 0xaf, 0xdb, 0xb5, 0x85, 0x24, 0xea, 0xe5, 0x70, 0x74, 0x3a, 0xa0,
0x55, 0xed, 0x5c, 0x60, 0x75, 0x58, 0x3a, 0x18, 0x41, 0x89, 0xc0, 0x4d, 0x2b, 0xd9, 0xc7, 0x00,
0x7a, 0x9e, 0xc1, 0x9f, 0x3e, 0xec, 0x88, 0xcb, 0x44, 0xa5, 0x94, 0xec, 0x3f, 0xe6, 0x12, 0x6f,
0x69, 0xed, 0xa6, 0x09, 0xda, 0x15, 0x73, 0x4b, 0x4b, 0x0f, 0x2a, 0x00, 0xf1, 0x93, 0x1a, 0x15,
0x8b, 0xc7, 0x77, 0xab, 0xa7, 0x12, 0x00, 0xc6, 0xf6, 0x76, 0x6c, 0x16, 0x1e, 0xdf, 0x5d, 0x67,
0x73, 0x66, 0xbf, 0xc0, 0x3b, 0x64, 0x43, 0x13, 0x67, 0x49, 0x86, 0xb7, 0xc7, 0xe6, 0xe6, 0x0c,
0x20, 0x49, 0x10, 0x1a, 0xba, 0x38, 0x43, 0x92, 0x27, 0x41, 0xe8, 0xfc, 0x59, 0x8d, 0x99, 0x2f,
0x5f, 0x64, 0xf8, 0x72, 0xf5, 0x14, 0x4f, 0x27, 0xeb, 0xe4, 0x49, 0x2b, 0x03, 0x26, 0x46, 0x7f,
0x8b, 0xcc, 0x34, 0x8d, 0x08, 0x6a, 0xc3, 0x4a, 0xc7, 0x1b, 0x37, 0x94, 0x02, 0x1f, 0xc4, 0x36,
0x6c, 0xe3, 0x9e, 0x4b, 0x51, 0xe9, 0x1e, 0x0a, 0xdf, 0x97, 0xaa, 0xdd, 0x43, 0xe1, 0xf3, 0xbf,
0xa7, 0xe9, 0xa7, 0xc2, 0xf6, 0x07, 0xe5, 0x30, 0x53, 0x64, 0x4a, 0xdc, 0x7a, 0x83, 0xde, 0x59,
0xc9, 0x14, 0xb9, 0x75, 0xe5, 0xd8, 0xf3, 0xdd, 0x91, 0x63, 0xcf, 0x17, 0xfd, 0x96, 0xe1, 0xde,
0xcb, 0xf8, 0x73, 0x92, 0x4c, 0xa5, 0x21, 0xf8, 0x57, 0x54, 0x21, 0x22, 0x7c, 0x2e, 0xd6, 0xf0,
0x96, 0x8c, 0xaa, 0x65, 0x34, 0xad, 0x08, 0x38, 0x29, 0x31, 0xa5, 0x34, 0xb5, 0x0f, 0xb6, 0xea,
0x28, 0x78, 0x9a, 0x2a, 0x48, 0xbf, 0x8d, 0xd2, 0x07, 0x1a, 0x6c, 0x5e, 0x2f, 0xbc, 0x67, 0xe8,
0x37, 0xa2, 0x9e, 0x2a, 0xfb, 0x78, 0xe1, 0x0a, 0x63, 0x04, 0xee, 0x06, 0x22, 0xb6, 0x2f, 0xa9,
0x50, 0xf2, 0x30, 0x10, 0xb1, 0xf3, 0x57, 0x35, 0xb6, 0x48, 0xef, 0x24, 0x64, 0x37, 0x55, 0x09,
0x86, 0x76, 0xf3, 0xa4, 0x2a, 0x3f, 0x69, 0x76, 0x89, 0xe7, 0x46, 0xf4, 0x26, 0xa4, 0x74, 0xc6,
0xf9, 0x45, 0xad, 0x12, 0x93, 0xb4, 0x1f, 0x74, 0x73, 0x5e, 0xfc, 0xb2, 0x50, 0x48, 0x7c, 0x64,
0x75, 0xf2, 0xbe, 0xe2, 0xbe, 0x50, 0x89, 0x84, 0x7a, 0x0b, 0xdc, 0xa2, 0x73, 0xa3, 0x96, 0x7c,
0xd1, 0x79, 0xfc, 0x47, 0x2f, 0x3a, 0x8f, 0x77, 0x3e, 0x66, 0x17, 0xed, 0x7f, 0x42, 0x30, 0xc1,
0xee, 0x63, 0xb4, 0x73, 0xcd, 0xff, 0x4a, 0x70, 0xdc, 0xfa, 0x06, 0x9b, 0x37, 0x3f, 0x09, 0xb4,
0x93, 0xc1, 0xbe, 0xf8, 0x42, 0xa9, 0x9d, 0x0a, 0x17, 0x58, 0x7d, 0xa8, 0xcc, 0x42, 0xfa, 0x84,
0xfe, 0xbf, 0x84, 0xa1, 0xa2, 0x95, 0xf4, 0x3a, 0x5b, 0x30, 0xf5, 0x17, 0x88, 0x6f, 0x23, 0xa2,
0x41, 0xe2, 0xe7, 0x06, 0x77, 0x85, 0x31, 0xad, 0x42, 0xbb, 0x1a, 0x3f, 0xa5, 0x3d, 0x0d, 0x25,
0xa0, 0xee, 0x4c, 0xe1, 0x7f, 0x4b, 0xf1, 0xee, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xe8, 0x92,
0xa9, 0xc9, 0xac, 0x42, 0x00, 0x00,
}
|
avantgarde-labs/dswarm
|
persistence/src/main/java/org/dswarm/persistence/model/job/Connection.java
|
<reponame>avantgarde-labs/dswarm
/**
* Copyright (C) 2013, 2014 <NAME> & Avantgarde Labs GmbH (<<EMAIL>>)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dswarm.persistence.model.job;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import org.dswarm.persistence.model.AdvancedDMPJPAObject;
@XmlRootElement
public class Connection extends AdvancedDMPJPAObject {
/**
*
*/
private static final long serialVersionUID = 1L;
private ConnectionType type;
@XmlTransient
private Component source;
@XmlTransient
private Component target;
public Connection(final String id) {
super(id);
}
public ConnectionType getType() {
return type;
}
public void setType(final ConnectionType type) {
this.type = type;
}
public Component getSource() {
return source;
}
public void setSource(final Component source) {
this.source = source;
}
public Component getTarget() {
return target;
}
public void setTarget(final Component target) {
this.target = target;
}
@XmlElement(name = "source")
public Long getSourceId() {
if (source == null) {
return null;
}
return source.getId();
}
@XmlElement(name = "target")
public Long getTargetId() {
if (target == null) {
return null;
}
return target.getId();
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.