// The context ID, it default to a string object, we can also use other objects.
#include<string>
// The context ID, it default to a string object, we can also use other objects.
// @remark User can directly user string as SrsContextId, we user struct to ensure the context is an object.
#if 1
struct_SrsContextId
{
std::stringv_;
@ -132,10 +134,18 @@ struct _SrsContextId
boolempty(){
returnv_.empty();
}
boolequals(const_SrsContextId&to){
returnv_==to.v_;
// Compare the two context id. @see http://www.cplusplus.com/reference/string/string/compare/
// 0 They compare equal
// <0 Either the value of the first character that does not match is lower in the compared string, or all compared characters match but the compared string is shorter.
// >0 Either the value of the first character that does not match is greater in the compared string, or all compared characters match but the compared string is longer.
intcompare(const_SrsContextId&to){
returnv_.compare(to.v_);
}
};
typedef_SrsContextIdSrsContextId;
#else
// Actually, we can directly user string as SrsContextId.